コード例 #1
0
ファイル: ASUser.php プロジェクト: akrana1990/bmoc
 /**
  * Class constructor
  * @param $userId ID of user that will be represented by this class
  */
 function __construct($userId)
 {
     //update local user id with given user id
     $this->userId = $userId;
     //connect to database
     $this->db = ASDatabase::getInstance();
 }
コード例 #2
0
 /**
  * Class constructor
  */
 function __construct()
 {
     //get database class instance
     $this->db = ASDatabase::getInstance();
     //create new object of ASEmail class
     $this->mailer = new ASEmail();
 }
コード例 #3
0
 public static function getAdmin()
 {
     $role = new ASRole();
     $db = ASDatabase::getInstance();
     $adminRoleId = $role->getId('admin');
     $result = $db->select('SELECT * FROM `as_users` WHERE `user_role` = :role_id', array('role_id' => $adminRoleId));
     if (count($result) > 0) {
         return $result[0];
     } else {
         return null;
     }
 }
コード例 #4
0
ファイル: AS.php プロジェクト: akrana1990/bmoc
<?php

include_once 'ASConfig.php';
include_once 'ASSession.php';
include_once 'ASValidator.php';
include_once 'ASLang.php';
include_once 'ASRole.php';
include_once 'ASDatabase.php';
include_once 'ASEmail.php';
include_once 'ASLogin.php';
include_once 'ASRegister.php';
include_once 'ASUser.php';
include_once 'ASComment.php';
$db = ASDatabase::getInstance();
ASSession::startSession();
$login = new ASLogin();
$register = new ASRegister();
$mailer = new ASEmail();
if (isset($_GET['lang'])) {
    ASLang::setLanguage($_GET['lang']);
}
コード例 #5
0
ファイル: ASLogin.php プロジェクト: akrana1990/bmoc
 /**
  * Class constructor
  */
 function __construct()
 {
     $this->db = ASDatabase::getInstance();
 }
コード例 #6
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     $this->db = ASDatabase::getInstance();
     $this->validator = new ASValidator();
 }