Select Git revision
RangeTreeIndex.php
Forked from
Stud.IP / Stud.IP
Source project has a limited visibility.
-
Thomas Hackl authored
Closes #1664, #2693, and #2692 Merge request studip/studip!1081
Thomas Hackl authoredCloses #1664, #2693, and #2692 Merge request studip/studip!1081
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
UserManagement.class.php 60.39 KiB
<?php
# Lifter007: TODO
/**
* UserManagement.class.php
*
* Management for the Stud.IP global users
*
* LICENSE
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* @author Stefan Suchi <suchi@data-quest>
* @author Suchi & Berg GmbH <info@data-quest.de>
* @copyright 2009 Stud.IP
* @license http://www.gnu.org/licenses/gpl-2.0.html GPL Licence 2
* @category Stud.IP
*/
// Imports
require_once 'lib/statusgruppe.inc.php'; // remove user from statusgroups
require_once 'lib/messaging.inc.php'; // remove messages send or recieved by user
require_once 'lib/object.inc.php';
/**
* UserManagement.class.php
*
* Management for the Stud.IP global users
*
*/
class UserManagement
{
private $user;
private $validator;
private $user_data;
public $msg;
private static $pwd_hasher;
public static function getPwdHasher()
{
if (self::$pwd_hasher === null) {
self::$pwd_hasher = new PasswordHash(8, Config::get()->PHPASS_USE_PORTABLE_HASH);
}
return self::$pwd_hasher;
}
/**
* Constructor
*
* Pass nothing to create a new user, or the user_id from an existing user to change or delete
* @param string $user_id the user which should be retrieved
*/
public function __construct($user_id = false)
{
$this->validator = new email_validation_class();
$this->validator->timeout = 10; // How long do we wait for response of mailservers?
$this->getFromDatabase($user_id);
}
public function __get($attr)
{
if ($attr === 'user_data') {
return $this->user_data;
}
}