Alternc
latest
Alternc logiel libre pour l'hébergement
|
This class manage user sessions in the web desktop. More...
Public Member Functions | |
alternc_password_policy () | |
Password kind used in this class (hook for admin class) More... | |
hook_menu () | |
hook called by the m_menu class to add menu to the left of the panel More... | |
checkright () | |
Check that the current user is an admnistrator. More... | |
login ($username, $password, $restrictip=0, $authip_token=false) | |
Start a session in the web desktop. More... | |
setid ($id) | |
Start a session as another user from an administrator account. More... | |
resetlast () | |
After a successful connection, reset the user's last connection date. More... | |
authip_token ($bis=false) | |
authip_tokencheck ($t) | |
checkid ($show_msg=true) | |
Check that the current session is correct (valid cookie) If necessary, and if we received username & password fields, create a new session for the user. More... | |
su ($uid) | |
Change the identity of the user temporarily (SUDO) More... | |
unsu () | |
Goes back to the original identity (of an admin, usually) More... | |
del_session () | |
Ends a session on the panel (logout) More... | |
passwd ($oldpass, $newpass, $newpass2) | |
Change the password of the current user. More... | |
adminpref ($admlist) | |
Change the administrator preferences of an admin account. More... | |
send_pass ($login) | |
Send a mail with a password to an account Note : We can ask for a password only once a day TODO : Translate this mail into the localization program. More... | |
ChangeMail1 ($newmail) | |
Change the email of an account (first step: sending of a Cookie) TODO : insert this mail string into the localization system. More... | |
ChangeMail2 ($COOKIE, $KEY, $uid) | |
Change the email of a member (second step, Cookie + key change) More... | |
set_help_param ($show) | |
Change the help parameter. More... | |
get_help_param () | |
tell if the help parameter is set More... | |
show_help ($file, $force=false) | |
show (echo) a contextual help More... | |
get_creator_by_uid ($uid) | |
alternc_export_conf () | |
Exports all the personal user related information for an account. More... | |
session_tempo_params_get ($v) | |
session_tempo_params_set ($k, $v, $ecrase=false) | |
send_reset_url ($email_or_login) | |
Sends a password-reset URL. More... | |
generate_reset_url ($uid) | |
Generate a reset URL for an account given it's e-mail or login. More... | |
_get_reset_url ($timestamp, $uid, $login, $password) | |
Builds a full reset URL from the uid, login, password and timestamp. More... | |
temporary_login ($uid, $timestamp, $token, $restrictip=0, $authip_token=false) | |
Logs a user in from a one-time login link. More... | |
requires_old_password_for_change () | |
validate_reset_url ($uid, $timestamp, $token) | |
Validates a reset URL that has been received. More... | |
Public Attributes | |
$olduid = 0 | |
Original uid for the temporary uid swapping (for administrators) More... | |
$user | |
This array contains the Tableau contenant les champs de la table "membres" du membre courant. More... | |
$local | |
contains all the fields of the "local" table for an account in AlternC. More... | |
This class manage user sessions in the web desktop.
This class manage user sessions and administration in AlternC.
m_mem::_get_reset_url | ( | $timestamp, | |
$uid, | |||
$login, | |||
$password | |||
) |
Builds a full reset URL from the uid, login, password and timestamp.
Definition at line 759 of file m_mem.php.
Referenced by generate_reset_url().
m_mem::adminpref | ( | $admlist | ) |
m_mem::alternc_export_conf | ( | ) |
Exports all the personal user related information for an account.
@access private
Definition at line 630 of file m_mem.php.
References $user.
m_mem::alternc_password_policy | ( | ) |
m_mem::authip_token | ( | $bis = false | ) |
m_mem::authip_tokencheck | ( | $t | ) |
boolean | $t |
Definition at line 233 of file m_mem.php.
References authip_token().
Referenced by login(), and temporary_login().
m_mem::ChangeMail1 | ( | $newmail | ) |
Change the email of an account (first step: sending of a Cookie) TODO : insert this mail string into the localization system.
string | $newmail | New mail we want to set for this account |
m_mem::ChangeMail2 | ( | $COOKIE, | |
$KEY, | |||
$uid | |||
) |
Change the email of a member (second step, Cookie + key change)
string | $COOKIE | Cookie sent by mail |
string | $KEY | cle shown on the screen |
integer | $uid | User id (we may not be connected) |
m_mem::checkid | ( | $show_msg = true | ) |
Check that the current session is correct (valid cookie) If necessary, and if we received username & password fields, create a new session for the user.
This function MUST be called by each page to authenticate the user. and BEFORE sending any data (since a cookie can be sent)
global | string $session the session cookie |
global | string $username & $password the login / pass of the user |
Definition at line 260 of file m_mem.php.
References login().
Referenced by validate_reset_url().
m_mem::checkright | ( | ) |
m_mem::del_session | ( | ) |
m_mem::generate_reset_url | ( | $uid | ) |
Generate a reset URL for an account given it's e-mail or login.
$email_or_login | A string with the email or login. |
Definition at line 739 of file m_mem.php.
References _get_reset_url().
Referenced by send_reset_url().
m_mem::get_creator_by_uid | ( | $uid | ) |
integer | $uid |
m_mem::get_help_param | ( | ) |
m_mem::hook_menu | ( | ) |
m_mem::login | ( | $username, | |
$password, | |||
$restrictip = 0 , |
|||
$authip_token = false |
|||
) |
Start a session in the web desktop.
Check username and password. Note : If the user entered a bas password, the failure will be logged and told to the corresponding user on next successfull login.
$username | string Username that want to get connected. |
$password | string User Password. |
Definition at line 83 of file m_mem.php.
References authip_tokencheck(), and resetlast().
Referenced by checkid().
m_mem::passwd | ( | $oldpass, | |
$newpass, | |||
$newpass2 | |||
) |
Change the password of the current user.
string | $oldpass | Old password |
string | $newpass | New password |
string | $newpass2 | New password (again) |
Definition at line 396 of file m_mem.php.
References requires_old_password_for_change().
m_mem::requires_old_password_for_change | ( | ) |
m_mem::resetlast | ( | ) |
After a successful connection, reset the user's last connection date.
Definition at line 208 of file m_mem.php.
Referenced by login(), and temporary_login().
m_mem::send_pass | ( | $login | ) |
Send a mail with a password to an account Note : We can ask for a password only once a day TODO : Translate this mail into the localization program.
TODO : Check this function's !
m_mem::send_reset_url | ( | $email_or_login | ) |
Sends a password-reset URL.
Definition at line 688 of file m_mem.php.
References generate_reset_url().
m_mem::session_tempo_params_set | ( | $k, | |
$v, | |||
$ecrase = false |
|||
) |
m_mem::set_help_param | ( | $show | ) |
Change the help parameter.
integer | $show | Shall we (1) or not (0) show the online help |
m_mem::setid | ( | $id | ) |
Start a session as another user from an administrator account.
This function is not the same as su. setid connect the current user in the destination account (for good), and su allow any user to become another account for some commands only. (del_user, add_user ...) and allow to bring back admin rights with unsu
$id | integer User id where we will connect to. |
Definition at line 174 of file m_mem.php.
m_mem::show_help | ( | $file, | |
$force = false |
|||
) |
show (echo) a contextual help
integer | $file | File number in the help system to show |
m_mem::su | ( | $uid | ) |
m_mem::temporary_login | ( | $uid, | |
$timestamp, | |||
$token, | |||
$restrictip = 0 , |
|||
$authip_token = false |
|||
) |
Logs a user in from a one-time login link.
Definition at line 776 of file m_mem.php.
References $c, authip_tokencheck(), resetlast(), and validate_reset_url().
m_mem::unsu | ( | ) |
m_mem::validate_reset_url | ( | $uid, | |
$timestamp, | |||
$token | |||
) |
Validates a reset URL that has been received.
Definition at line 891 of file m_mem.php.
References checkid().
Referenced by temporary_login().
m_mem::$local |
m_mem::$olduid = 0 |
m_mem::$user |
This array contains the Tableau contenant les champs de la table "membres" du membre courant.
Definition at line 36 of file m_mem.php.
Referenced by alternc_export_conf(), and del_session().