Fix post-sync login
This commit is contained in:
@@ -157,7 +157,7 @@ class Auth extends PhpObject
|
||||
return ($this->sApiKey!='' && $sApiKey==$this->sApiKey);
|
||||
}
|
||||
|
||||
private function resetPass($iUserId=0)
|
||||
public function resetPass($iUserId=0)
|
||||
{
|
||||
$sUserIdCol = Db::getId(self::USER_TABLE);
|
||||
$sUserTextCol = Db::getText(self::USER_TABLE);
|
||||
@@ -168,7 +168,7 @@ class Auth extends PhpObject
|
||||
$asUsers = $this->oDb->selectRows($asInfo);
|
||||
foreach($asUsers as $asUser)
|
||||
{
|
||||
$sToken = self::hashPassword(self::getLoginToken($asUser[$sUserTextCol]));
|
||||
$sToken = self::hashPassword(self::getLoginToken('123456'));
|
||||
$this->oDb->updateRow(self::USER_TABLE, array(Db::getId(self::USER_TABLE)=>$asUser[$sUserIdCol]), array('pass'=>$sToken));
|
||||
}
|
||||
}
|
||||
@@ -179,8 +179,7 @@ class Auth extends PhpObject
|
||||
$sServerName = array_key_exists('SERVER_NAME', $_SERVER)?$_SERVER['SERVER_NAME']:$_SERVER['PWD'];
|
||||
$sAppPath = $_SERVER['REQUEST_SCHEME'].'://'.str_replace(array('http://', 'https://'), '', $sServerName.dirname($_SERVER['SCRIPT_NAME']));
|
||||
$_GET['serv_name'] = $sAppPath.(mb_substr($sAppPath, -1)!='/'?'/':'');
|
||||
//return md5($sPass.$_GET['serv_name']);
|
||||
return md5($sPass.'http://localhost/catc/');
|
||||
return md5($sPass.$_GET['serv_name']);
|
||||
}
|
||||
|
||||
private function resetAuthCookie($iUserId)
|
||||
|
||||
@@ -236,8 +236,13 @@ class CATC extends Main
|
||||
$bSuccess = ($sDesc=='');
|
||||
unlink($sBackupPath);
|
||||
|
||||
//Check for missing files
|
||||
$asMissingFiles = (new Doc($this->oDb))->getMissingFiles();
|
||||
if($bSuccess) {
|
||||
//Reset passwords
|
||||
$this->oAuth->resetPass();
|
||||
|
||||
//Check for missing files
|
||||
$asMissingFiles = (new Doc($this->oDb))->getMissingFiles();
|
||||
}
|
||||
|
||||
//Send list of missing files back
|
||||
return self::getJsonResult($bSuccess, $sDesc, array('files'=>$asMissingFiles));
|
||||
|
||||
11
readme.md
11
readme.md
@@ -1,15 +1,20 @@
|
||||
# CATC Notes
|
||||
Prise de notes pour les cours du Collège des Arts Thérapeutiques Chinois
|
||||
|
||||
#Install
|
||||
* Activate PHP modules: curl
|
||||
* Copy settings-sample.php -> settings.php & update values
|
||||
|
||||
# Todo
|
||||
* [x] Upload/Download docs: audio, video, word, pdf
|
||||
* [ ] View docs online: audio, video, word, pdf
|
||||
* [x] Take notes on courses
|
||||
* [ ] Quick view of muscles / nerves schemas
|
||||
* [x] Quick view of muscles / nerves schemas
|
||||
* [x] Dictionary
|
||||
* [x] Progress bar
|
||||
* [x] Save note on F5/quit
|
||||
* [ ] Sync local with remote repository
|
||||
* [x] Sync local with remote repository
|
||||
* [x] Table in Quill JS
|
||||
* [ ] Font Awesome icons in Quill JS Toolbar
|
||||
* [ ] Todo lists
|
||||
* [ ] Todo lists
|
||||
* [ ] Bug sync + login hash
|
||||
@@ -282,8 +282,7 @@ function setElem(anchor, path, value)
|
||||
function getLoginToken(sPass)
|
||||
{
|
||||
if(!window.location.origin) window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
|
||||
//return md5(sPass+window.location.origin+window.location.pathname);
|
||||
return md5(sPass+'http://localhost/catc/');
|
||||
return md5(sPass+window.location.origin+window.location.pathname);
|
||||
}
|
||||
|
||||
var defaultDiacriticsRemovalap = [
|
||||
|
||||
Reference in New Issue
Block a user