pass reset function
This commit is contained in:
@@ -2387,20 +2387,27 @@ class Databap extends PhpObject
|
|||||||
return $this->getJsonPostResult($bSuccess, $sDesc);
|
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)),
|
if($iUserId>0)
|
||||||
'from'=> self::USER_TABLE,
|
|
||||||
'join'=> array(self::COMP_TABLE=>MySqlManager::getId(self::COMP_TABLE)));
|
|
||||||
$asUsers = $this->oMySql->selectRows($asInfo);
|
|
||||||
foreach($asUsers as $asUser)
|
|
||||||
{
|
{
|
||||||
$sToken = $this->oAuth->HashPassword(self::getLoginToken($asUser[MySqlManager::getText(self::COMP_TABLE)]));
|
$sUserIdCol = MySqlManager::getId(self::USER_TABLE, true);
|
||||||
$iUserId = $asUser[MySqlManager::getId(self::USER_TABLE)];
|
$asInfo = array('select'=>array($sUserIdCol, MySqlManager::getText(self::COMP_TABLE)),
|
||||||
$this->oMySql->updateRow(self::USER_TABLE, $iUserId, array('pass'=>$sToken));
|
'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';
|
return 'OK';
|
||||||
}*/
|
}
|
||||||
|
|
||||||
private function getExternalAccessPass($iUserId)
|
private function getExternalAccessPass($iUserId)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -189,6 +189,9 @@ if($bUserOk && $sAction!=Databap::EXT_ACCESS)
|
|||||||
$asInfo = explode('-', strtolower($oUser));
|
$asInfo = explode('-', strtolower($oUser));
|
||||||
$sResult = 'User added. Id='.$oDatabap->addUser($asInfo[0], $asInfo[1], $asInfo[2], array_key_exists(3, $asInfo)?$asInfo[3]:'');
|
$sResult = 'User added. Id='.$oDatabap->addUser($asInfo[0], $asInfo[1], $asInfo[2], array_key_exists(3, $asInfo)?$asInfo[3]:'');
|
||||||
break;
|
break;
|
||||||
|
case 'reset_pass':
|
||||||
|
$sResult = $oDatabap->resetPass($oUser);
|
||||||
|
break;
|
||||||
case 'build_index':
|
case 'build_index':
|
||||||
$oDatabap->buildCompleteIndex();
|
$oDatabap->buildCompleteIndex();
|
||||||
$sResult = 'Index ok';
|
$sResult = 'Index ok';
|
||||||
|
|||||||
Reference in New Issue
Block a user