__construct() public method

public __construct ( )
Beispiel #1
0
 /**
  * Tests User->__construct()
  */
 public function test__construct()
 {
     $this->User->__construct();
     if (get_class($this->User) != 'User') {
         $this->fail();
     }
 }
Beispiel #2
0
 public function __construct($id, $mail, $name, $description, $skLeague)
 {
     parent::__construct($id, $mail);
     $this->name = $name;
     $this->description = $description;
     $this->skLeague = $skLeague;
 }
Beispiel #3
0
 function __construct($uname = null)
 {
     parent::__construct();
     $this->page_error = "";
     $this->setLoginTemplates();
     $this->scriptspresent = FALSE;
 }
Beispiel #4
0
 /**
  * Constructor.
  * The parameter is used for preventing "strict" error.
  *
  * @param bool|int $id
  *
  * @todo избавиться от hardcoded имен полей формы?
  */
 public function __construct($id = false)
 {
     if (isset($_SESSION['UID'])) {
         $id = $_SESSION['UID'];
     }
     parent::__construct($id);
 }
Beispiel #5
0
 public function __construct($name, $email)
 {
     $this->_date = "11-01-1996";
     $this->_type = "Viewer";
     $this->_level = 1;
     parent::__construct($name, $email);
 }
Beispiel #6
0
 function __construct(&$db, $id = false)
 {
     parent::__construct($db);
     if (!$id) {
         $this->id = 0;
         $this->login = '';
         $this->name = '';
         $this->family = '';
         $this->daddy = '';
         $this->mobile_telephone = '';
         $this->is_deleted = false;
         $this->groups = array();
         $this->groups_flip = array();
         $this->groups_SQL = '';
         $this->set_groups_sql = false;
         return;
     }
     $this->id = $id;
     if (!($row = $this->db->Query_Fetch_Assoc("SELECT * FROM users WHERE id=" . $this->id . " LIMIT 0,1"))) {
         throw new SysUserError("невозможно создать объект - не найдена запись в БД", $this->id);
     }
     $this->login = $row["login"];
     $this->name = $row["name"];
     $this->family = $row["family"];
     $this->daddy = $row["daddy"];
     $this->mobile_telephone = $row["mobile_telephone"];
     $this->is_deleted = $row["is_deleted"] == 0 ? false : true;
     if (!($result = $this->db->Query_Fetch("SELECT group_id FROM groups_users WHERE user_id=" . $this->id))) {
         throw new SysUserError("невозможно создать объект - не найдено записей груп", $this->id, $this->login);
     }
     foreach ($result as $row) {
         $this->groups[] = $row["group_id"];
     }
 }
 function __construct($id, $gebruikersnaam = "", $voornaam = "", $achternaam = "", $laatsteOnline = "", $email = "", $mails = 1, $verwijderd = "0")
 {
     if ($id == "") {
         //nieuw personeel
         parent::__construct($id, $gebruikersnaam, $voornaam, $achternaam, $laatsteOnline, $email);
         $this->verwijderd = $verwijderd;
         $this->mails = $mails;
         if (self::isInPersoneelDatabase($this->id)) {
             self::setVerwijderd(0);
             self::setMails($this->mails);
             self::save();
         } else {
             echo "ik ga personeel toevoegen aan de databank";
             $statement = $this->db->prepare("INSERT INTO personeel (userId, mails, verwijderd) VALUES (?, ?, ?)");
             echo $this->db->error;
             $statement->bind_param('iii', $this->id, $this->mails, $this->verwijderd);
             $statement->execute();
             $statement->close();
         }
     } else {
         if (!is_numeric($id)) {
             throw new BadParameterException();
         }
         parent::__construct($id);
         $this->db = DB::getDB();
         $statement = $this->db->prepare("SELECT verwijderd, mails FROM personeel WHERE userId = ?");
         $statement->bind_param('i', $id);
         $statement->execute();
         $statement->store_result();
         $statement->bind_result($this->verwijderd, $this->mails);
         $statement->fetch();
         $statement->close();
     }
     $this->updated = 0;
 }
 public function __construct($name, $login, $password, $role)
 {
     parent::__construct($name, $login, $password);
     $this->role = $role;
     ++self::$Count;
     --parent::$Count;
 }
Beispiel #9
0
 function __construct($failed = false)
 {
     parent::__construct();
     if (!$failed) {
         $this->uid = $this->authorize_cookie();
     }
 }
Beispiel #10
0
 function __construct($n, $l, $p, $r)
 {
     ++self::$cntSUser;
     parent::__construct($n, $l, $p);
     $this->role = $r;
     parent::$cntUser--;
 }
Beispiel #11
0
 public function __construct($email, $password, $key)
 {
     parent::__construct($email, $password);
     if ($key != 'AUTOR_DE_PLATZI') {
         throw new \InvalidArgumentException("Invalid key given");
     }
 }
 /**
  * UserAsCustomer constructor.
  */
 public function __construct($user_id, $email, $password)
 {
     parent::__construct($user_id, $email, $password);
     $this->orders = array();
     /*ideiglenesen mert ez egy picitt bonyolult lesz*/
     $this->cart = $this->loadCart();
     $this->actualOrder = null;
 }
Beispiel #13
0
 /**
  * Constructeur
  * 
  * @param string $data
  * @param int $meanOfLogin
  * @param string $pass
  * @param string $ip[optional]
  * @param int $noPass[optional] 1 si connexion sans mot de passe (badgeage simple au foyer)
  * @param int $poi_id
  */
 public final function __construct($data, $meanOfLogin, $pass, $ip = 0, $noPass = 0, $poi_id)
 {
     parent::__construct($data, $meanOfLogin, $pass, $ip, $noPass);
     $this->poi_id = $poi_id;
     if ($this->getState() == 1) {
         $this->state = $this->isAllowedOnPoint($this->poi_id);
     }
 }
Beispiel #14
0
 function __construct($name, $login, $password, $role)
 {
     //конструктор
     parent::__construct($name, $login, $password);
     $this->role = $role;
     self::$userCount++;
     parent::$userCount--;
 }
Beispiel #15
0
 /**
  * Constructor.
  *
  * @param CentralAuthenticationStore $cas    Shared instance of the credentials store
  * @param LoggerInterface            $logger Shared instance of a Logger class.
  * @param Curl                       $curl   Shared instance of the Curl class.
  */
 public function __construct($cas, $logger, $curl)
 {
     parent::__construct($cas, $logger, $curl);
     $this->limit = 25;
     $this->next = 0;
     $this->previous = 0;
     $this->fetched_user_data = FALSE;
 }
Beispiel #16
0
 function __construct($n, $l, $p, $g)
 {
     parent::__construct($n, $l, $p);
     $this->got = $g;
     parent::showInfo();
     ++self::$hows;
     --parent::$howu;
 }
Beispiel #17
0
 public function __construct($db = null)
 {
     if (is_null($db)) {
         global $dbConfig;
     } else {
         $dbConfig = $db;
     }
     parent::__construct(new mysqli($dbConfig['host'], $dbConfig['username'], $dbConfig['password'], $dbConfig['dbname']));
 }
Beispiel #18
0
 /**
  * Constructeur
  * @param $nom
  * @param $prenom
  * @param $edition
  * @param $biography
  */
 public function __construct($nom, $prenom, $niveau)
 {
     parent::__construct($nom, $prenom);
     $this->niveau = $niveau;
     //to handle 500 error
     if ($niveau > 10) {
         trigger_error('Le modérateur ne peut se voir un niveau supérieur à 10', E_USER_WARNING);
     }
 }
Beispiel #19
0
 public function __construct($role)
 {
     if (!empty($role)) {
         $data = parent::__construct('a', 'b', 'c');
         echo $data . ' You role: ' . $role . '<br>';
     } else {
         echo 'Введите роль';
     }
 }
Beispiel #20
0
 public function __construct($data = array())
 {
     parent::__construct($data);
     $this->utype = "student";
     $this->fname = isset($data['fname']) ? trim($data['fname']) : "";
     $this->lname = isset($data['lname']) ? trim($data['lname']) : "";
     $this->fullName = $this->fname . " " . $this->lname;
     $this->title = isset($data['title']) ? $data['title'] : "";
 }
Beispiel #21
0
 public function __construct($data = array())
 {
     parent::__construct($data);
     $this->compName = isset($data['compName']) ? $data['compName'] : "";
     $this->fullName = $this->compName;
     $this->utype = "employer";
     if ($this->displayPic == "default_dp.png") {
         $this->displayPic = "briefcase.png";
     }
 }
Beispiel #22
0
 function __construct($uname = null)
 {
     parent::__construct();
     $this->page_error = "";
     $this->registerTemplates = array('register' => 'register', 'address' => 'address', 'block' => 'block');
     $this->registerScripts = array('map' => 'map', 'getblocks' => 'getblocks');
     $this->setRegisterTemplates();
     $this->setMap();
     $this->scriptspresent = FALSE;
 }
Beispiel #23
0
 /**
  * The constructor for a Tutor
  *
  * @param int $ID
  * @param int $PIN
  * @param string $email
  * @param string $phone
  * @param Schedule $schedule
  * @param Timesheet $timesheet
  * @param string $picture Path to the file that contains the tutors picture
  * @param string $bio The tutors provided biography
  */
 public function __construct($ID, $PIN, $name, $email = "", $phone = "", $picture = "", $bio = "", Schedule $schedule = null, array $timesheets = array())
 {
     parent::__construct($ID, $PIN, $name);
     $this->email = $email;
     $this->phone = $phone;
     $this->schedule = $schedule != null ? $schedule : new Schedule();
     $this->timesheets = $timesheets;
     $this->picture = $picture;
     $this->bio = $bio;
 }
Beispiel #24
0
 public function __construct($inUserID = 0, $inUserRole = GUEST_ROLE_ID, $inGivenIdentifier = 'anonymous', $inUserName = '******', $inFirstName = 'Anonymous', $inLastName = 'Guest', $inEmail = '*****@*****.**', Link $inProfilePictureLocation = null, DateTime $inBirthday = null, $isLoggedIn = false)
 {
     if ($inProfilePictureLocation === null) {
         $inProfilePictureLocation = new Link('images/defaultUserPicture.png');
     }
     if (!is_bool($isLoggedIn)) {
         return;
     }
     $this->isLoggedIn = $isLoggedIn;
     parent::__construct($inUserID, $inUserRole, $inGivenIdentifier, $inUserName, $inFirstName, $inLastName, $inEmail, $inProfilePictureLocation, $inBirthday);
 }
Beispiel #25
0
 function __construct($id = false, $table = null, $ds = null)
 {
     global $databases;
     if (!defined('DRUPAL_ROOT')) {
         define('DRUPAL_ROOT', Configure::read('security.drupal_root'));
         require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
         drupal_settings_initialize();
     }
     $this->useTable = $databases['default']['default']['prefix'] . 'users';
     parent::__construct($id, $table, $ds);
 }
Beispiel #26
0
 public function __construct($user = NULL)
 {
     parent::__construct();
     self::$fs =& $this->getModule('FS');
     if (isset($user)) {
         $this->user = $user;
         self::$fs->newAlias('~', 'users/' . $user);
     } else {
         $this->user = $this->getUsername();
     }
 }
Beispiel #27
0
 public function __construct($user, $email, $pass, $phone_number, $first_name, $last_name, $address)
 {
     parent::__construct($user, $pass);
     $this->emailAddress = $email;
     $this->firstName = $first_name;
     $this->lastName = $last_name;
     $this->shippingAddress = $address;
     $this->phoneNumber = $phone_number;
     $this->cart = new Cart();
     $this->orders = array();
 }
 public function __construct($user_id)
 {
     parent::__construct($user_id);
     if (!$this->isAdmin()) {
         // Specialst extends Resident (has more privileges)
         $this->_loginRedirect();
         //log failure
         $log = debug_backtrace();
         throw new Exception('No privileges');
     }
 }
Beispiel #29
0
 /**
  * Constructor that will create an object of a recordset of the users table.
  * If the id is set than this recordset will be loaded.
  * @param object $db             Object of the class database. This could be the default object @b $gDb.
  * @param object $userFields     An object of the ProfileFields class with the profile field structure
  *                               of the current organization. This could be the default object @b $gProfileFields.
  * @param int    $userId         The id of the user who should be loaded. If id isn't set than an empty object
  *                               with no specific user is created.
  * @param int    $organizationId The id of the organization for which the user should be registered.
  *                               If no id is set than the user will be registered for the current organization.
  */
 public function __construct(&$db, $userFields, $userId = 0, $organizationId = 0)
 {
     global $gCurrentOrganization;
     $this->sendEmail = true;
     parent::__construct($db, $userFields, $userId);
     if ($organizationId > 0) {
         $this->setOrganization($organizationId);
     }
     // create recordset for registration table
     $this->TableRegistration = new TableAccess($this->db, TBL_REGISTRATIONS, 'reg');
     $this->TableRegistration->readDataByColumns(array('reg_org_id' => $this->organizationId, 'reg_usr_id' => $userId));
 }
Beispiel #30
0
 function __construct($mail = "", $mdp = "", $id = "", $ip = "", $nom = "", $prenom = "", $adresse = "", $cp = "", $ville = "", $qualite = "")
 {
     parent::__construct($ip);
     $this->id = $id;
     $this->nom = $nom;
     $this->prenom = $prenom;
     $this->adresse = $adresse;
     $this->cp = $cp;
     $this->ville = $ville;
     $this->qualite = $qualite;
     $this->mail = $mail;
     $this->mdp = $mdp;
 }