2016-11-08 09:25:15 +00:00
|
|
|
<?php
|
|
|
|
|
2016-11-08 09:29:34 +00:00
|
|
|
namespace api\module;
|
2016-11-08 09:25:15 +00:00
|
|
|
|
|
|
|
use \error\core\Error;
|
|
|
|
|
|
|
|
|
|
|
|
class authentification{
|
|
|
|
|
|
|
|
|
|
|
|
/* RENEW CYCLING HASH
|
|
|
|
*
|
|
|
|
* @hash<String> New hash
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
public static function renew($args){
|
|
|
|
extract($args);
|
|
|
|
|
|
|
|
/* (1) Fetch cyclic-hashing-system -> check file */
|
|
|
|
$fn = __BUILD__.'/api/chs/hash';
|
|
|
|
|
|
|
|
if( !is_file($fn) )
|
|
|
|
return ['ModuleError'=>Error::UnreachableResource];
|
|
|
|
|
|
|
|
/* (2) Stores new hash */
|
|
|
|
file_put_contents($fn, $hash);
|
|
|
|
|
|
|
|
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|