Skip to content
Snippets Groups Projects
Select Git revision
  • bb5570a73ae46c42d8b0d4123a6f0e6ca5aeaa56
  • main default protected
  • studip-rector
  • ci-opt
  • course-members-export-as-word
  • data-vue-app
  • pipeline-improvements
  • webpack-optimizations
  • rector
  • icon-renewal
  • http-client-and-factories
  • jsonapi-atomic-operations
  • vueify-messages
  • tic-2341
  • 135-translatable-study-areas
  • extensible-sorm-action-parameters
  • sorm-configuration-trait
  • jsonapi-mvv-routes
  • docblocks-for-magic-methods
19 results

StructuralElementsShow.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;
            }
        }