Roxen.git
/
server
/
modules
/
examples
/
auth.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/examples/auth.pike:1:
#include <module.h> inherit "module"; // All roxen modules must inherit module.pike
-
constant cvs_version = "$Id: auth.pike,v 1.
1
2000/
08
/
28
16
:
05
:
26
jhs
Exp $";
+
constant cvs_version = "$Id: auth.pike,v 1.
2
2000/
11
/
21
19
:
01
:
31
per
Exp $";
constant module_type = MODULE_AUTH; constant module_name = "RefDoc for MODULE_AUTH"; constant module_doc = #"This module does nothing, but its inlined documentation gets imported into the roxen programmer manual. You definetely don't want to use this module in your virtual servers, since anybody with access to your admin interface or server configuration file automatically gains access to all your passwords. For a budding roxen programmer, the module however does show the basics of making an authentication module."; void create()
Roxen.git/server/modules/examples/auth.pike:72:
//! crypted password, //! used id, //! group id, //! name, //! homedirectory, //! login shell //! })</pre> //! //! All entries should be strings, except uid and gid, who should be integers. {
-
string
user,
passwd, name = "J. Random Hacker", homedir, shell = "/bin/zsh";
+
string passwd, name = "J. Random Hacker", homedir, shell = "/bin/zsh";
int uid, gid; array(string) matching_users = glob(user + ":*", query("users")); if(!sizeof(matching_users)) return 0; sscanf(matching_users[0], "%*s:%s", passwd); sscanf(user, "%"+sizeof(user)+"c", uid); gid = uid; homedir = "/home/" + user; return ({ user, crypt(passwd), uid, gid, name, homedir, shell }); }