pass reset function
This commit is contained in:
@@ -2387,20 +2387,27 @@ class Databap extends PhpObject
|
||||
return $this->getJsonPostResult($bSuccess, $sDesc);
|
||||
}
|
||||
|
||||
/*public function resetAllPass()
|
||||
public function resetPass($iUserId)
|
||||
{
|
||||
$asInfo = array('select'=>array(MySqlManager::getId(self::USER_TABLE, true), MySqlManager::getText(self::COMP_TABLE)),
|
||||
'from'=> self::USER_TABLE,
|
||||
'join'=> array(self::COMP_TABLE=>MySqlManager::getId(self::COMP_TABLE)));
|
||||
$asUsers = $this->oMySql->selectRows($asInfo);
|
||||
foreach($asUsers as $asUser)
|
||||
if($iUserId>0)
|
||||
{
|
||||
$sToken = $this->oAuth->HashPassword(self::getLoginToken($asUser[MySqlManager::getText(self::COMP_TABLE)]));
|
||||
$iUserId = $asUser[MySqlManager::getId(self::USER_TABLE)];
|
||||
$this->oMySql->updateRow(self::USER_TABLE, $iUserId, array('pass'=>$sToken));
|
||||
$sUserIdCol = MySqlManager::getId(self::USER_TABLE, true);
|
||||
$asInfo = array('select'=>array($sUserIdCol, MySqlManager::getText(self::COMP_TABLE)),
|
||||
'from'=> self::USER_TABLE,
|
||||
'join'=> array(self::COMP_TABLE=>MySqlManager::getId(self::COMP_TABLE)),
|
||||
'constraint'=>array($sUserIdCol=>$iUserId));
|
||||
$asUsers = $this->oMySql->selectRows($asInfo);
|
||||
foreach($asUsers as $asUser)
|
||||
{
|
||||
$sToken = $this->oAuth->HashPassword(self::getLoginToken($asUser[MySqlManager::getText(self::COMP_TABLE)]));
|
||||
$iUserId = $asUser[MySqlManager::getId(self::USER_TABLE)];
|
||||
$this->oMySql->updateRow(self::USER_TABLE, $iUserId, array('pass'=>$sToken));
|
||||
}
|
||||
}
|
||||
else return 'KO';
|
||||
|
||||
return 'OK';
|
||||
}*/
|
||||
}
|
||||
|
||||
private function getExternalAccessPass($iUserId)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user