Skip to content
Snippets Groups Projects
Select Git revision
  • 9b6bd7e747bd5ed44d169a8e1baee0e519d209d6
  • main default protected
  • step-3263
  • feature/plugins-cli
  • feature/vite
  • step-2484-peerreview
  • biest/issue-5051
  • tests/simplify-jsonapi-tests
  • fix/typo-in-1a70031
  • feature/broadcasting
  • database-seeders-and-factories
  • feature/peer-review-2
  • feature-feedback-jsonapi
  • feature/peerreview
  • feature/balloon-plus
  • feature/stock-images-unsplash
  • tic-2588
  • 5.0
  • 5.2
  • biest/unlock-blocks
  • biest-1514
21 results

StudipComment.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    UserManagement.class.php 58.08 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;
            }
        }