コード例 #1
0
 public static function authenticate($username, $password)
 {
     if (empty($username) || empty($password)) {
         return NULL;
     }
     //TODO sql escape
     $SQL = "SELECT * FROM " . TBL_ADMIN_USERS . "  WHERE userName='******' AND userPassword='******'";
     $query = mysql_query($SQL, DBUtils::getManualConnection());
     if (empty($query)) {
         return NULL;
     }
     while ($db_field = mysql_fetch_assoc($query)) {
         $admin_user = AdminUsersModel::createAdminUserWithSQL($db_field);
         if (!empty($admin_user)) {
             return $admin_user;
         }
     }
     return null;
 }
コード例 #2
0
ファイル: admin_users.php プロジェクト: kirygithub/chatNow
		
		<?php 
        if (isset($message)) {
            echo sprintf('<p>%s</p>', $message);
        }
        ?>
		<table>
			<thead>
				<tr>
					<th width="100">Actions</th>
					<th>User</th>
				</tr>
			</thead>
			<tbody>
				<?php 
        $admin_users_model = new AdminUsersModel();
        $admin_users_model->setOrderBy('user ASC');
        $admin_users = $admin_users_model->load_all();
        foreach ($admin_users as $admin_user) {
            echo '<tr>';
            echo '<td><a href="?action=delete&admin_user='******'id'] . '">Delete</a> | <a href="?action=edit&admin_user='******'id'] . '">Edit</a></td>';
            echo '<td>' . $admin_user['user'] . '</td>';
            echo '</tr>';
        }
        ?>
			</tbody>
		</table>
	
<?php 
        break;
}
コード例 #3
0
 /**
  * get single AdminUsersModel instance from a DOMElement
  *
  * @param DOMElement $node
  * @return AdminUsersModel
  */
 public static function fromDOMElement(DOMElement $node)
 {
     $o = new AdminUsersModel();
     $o->assignByHash(self::domNodeToHash($node, self::$FIELD_NAMES, self::$DEFAULT_VALUES, self::$FIELD_TYPES));
     $o->notifyPristine();
     return $o;
 }