Ejemplo n.º 1
0
 public static function banAccount($accountId)
 {
     if (isset($accountId)) {
         $db = db::getInstance();
         $stmt = $db->prepare('UPDATE
                 tblUserAccount
             SET
                 tblUserAccount_banned = 1
             WHERE
                 tblUserAccount_accId = :aid');
         $stmt->bind_param('aid', $accountId);
         $stmt->execute();
     }
 }
Ejemplo n.º 2
0
 public static function saveUnauthorizedAccess($checksum, $accountId)
 {
     if (isset($checksum) && isset($accountId)) {
         $db = db::getInstance();
         $stmt = $db->prepare('SELECT
                 count(tblAPIUnauthorizedAccess_accessId)
             AS
                 counter
             FROM
                 tblAPIUnauthorizedAccess
             WHERE
                 tblAPIUnauthorizedAccess_accountId = :aid');
         $stmt->bind_param('aid', $accountId);
         $stmt->execute();
         $result = $stmt->fetch_assoc();
         $stmt2 = $db->prepare('INSERT INTO
                 tblAPIUnauthorizedAccess
             SET
                 tblAPIUnauthorizedAccess_checksum = :csum,
                 tblAPIUnauthorizedAccess_accountId = :accId');
         $stmt2->bind_param('csum', $checksum);
         $stmt2->bind_param('accId', $accountId);
         $stmt2->execute();
         if ($result['counter'] >= 1) {
             Account::killSession();
             Account::banAccount($accountId);
             return 'banned';
         }
     }
 }
 public function addAccount($accountData)
 {
     if (!isset($accountData)) {
         // Error Handling
         return false;
     } else {
         if ($this->validateData($accountData) == false) {
             return false;
         } else {
             $db = db::getInstance();
             $stmt = $db->prepare('INSERT INTO
                     tblUserAccount
                 SET
                     tblUserAccount_loginName = :lName,
                     tblUserAccount_pwd = :password,
                     tblUserAccount_email = :accountmail');
             $stmt->bind_param('lName', $this->loginName);
             $stmt->bind_param('password', $this->password);
             $stmt->bind_param('accountmail', $this->email);
             $stmt->execute();
             return true;
         }
     }
 }