/[projects]/misc/checkuser/cpp/stdpam.cpp
ViewVC logotype

Annotation of /misc/checkuser/cpp/stdpam.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (hide annotations) (download)
Wed Sep 16 20:13:41 2009 UTC (14 years, 8 months ago) by torben
File size: 748 byte(s)
Added some old code for storage/ reference


1 torben 328
2     #include "stdpam.h"
3     #include <string>
4     #include <iostream>
5    
6    
7     using namespace std;
8    
9    
10     string StdPam::promptEchoOn(string msg)
11     {
12     if (msg == "login: ")
13     cout << "Login: " ;
14     else
15     cout << __FUNCTION__ << " = " << msg << ": ";
16    
17     char buf[128];
18     cin.getline(buf,128);
19     string input = string(buf);
20     if (input.size() == 0)
21     input = " ";
22     return input;
23     }
24    
25     string StdPam::promptEchoOff(string msg)
26     {
27     if (msg == "Password: ")
28     cout << msg ;
29     else
30     cout << __FUNCTION__ << " = " << msg << ": ";
31     string input = getpass("");
32     if (input.size() == 0)
33     input = " ";
34     return input;
35     }
36    
37     void StdPam::errorMsg(string msg)
38     {
39     cout << __FUNCTION__ << " : " << msg << endl;
40     }
41    
42     void StdPam::textInfo(string msg)
43     {
44     cout << __FUNCTION__ << " : " << msg << endl;
45     }

  ViewVC Help
Powered by ViewVC 1.1.20