|
|
@@ -72,7 +72,7 @@ class Route_Cron extends RouteBase {
|
|
|
if (!$createDateTimestamp) throw new HttpException("Unauthorized - token not found #5-" . __LINE__, 401);
|
|
|
DBG::_('DBG_CRON', '>1', 'rawToken', array('createDateTimestamp'=>$createDateTimestamp, 'ttl'=>$ttl, 'cur'=>time()), __CLASS__, __FUNCTION__, __LINE__);
|
|
|
if ($createDateTimestamp + $ttl < time()) {
|
|
|
- // TODO: remove record from table?
|
|
|
+ // TODO: remove record from table - one time action?
|
|
|
throw new HttpException("Unauthorized - token expired #6-" . __LINE__, 401);
|
|
|
}
|
|
|
|
|
|
@@ -84,11 +84,13 @@ class Route_Cron extends RouteBase {
|
|
|
$_SESSION['ADM_ID'] = 9999999999;
|
|
|
DBG::_('DBG_CRON', '>1', 'rawToken', array('createDateTimestamp'=>$createDateTimestamp, 'ttl'=>$ttl, 'cur'=>time()), __CLASS__, __FUNCTION__, __LINE__);
|
|
|
$this->runTask($task);
|
|
|
+ exit;
|
|
|
}
|
|
|
|
|
|
public function executeCurlTastByToken($cronTaskName, $keyToken, $token, $args = []) { // @require $_SERVER['SERVER_NAME']
|
|
|
$baseUrl = "https://{$_SERVER['SERVER_NAME']}/SE";
|
|
|
if ('biuro.biall-net.pl' == $_SERVER['SERVER_NAME']) $baseUrl = "https://{$_SERVER['SERVER_NAME']}/SE/version-git";
|
|
|
+ // if ('biuro.biall-net.pl' == $_SERVER['SERVER_NAME']) $baseUrl = "https://{$_SERVER['SERVER_NAME']}/dev-pl/se-master"; // DBG
|
|
|
|
|
|
//file_get_contents("https://{$baseUrl}/index.php?_route=Cron&_key={$keyToken}&_token={$token}&_task=sendNotify");
|
|
|
$url = "{$baseUrl}/index.php?_route=Cron&_key={$keyToken}&_token={$token}&_task={$cronTaskName}";
|
|
|
@@ -203,7 +205,6 @@ class Route_Cron extends RouteBase {
|
|
|
echo "\n.EOF\n";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/* @usage - inside cli script with args:
|
|
|
* $cronTaskName = 'forceTablePerms';
|
|
|
* $keyToken = 'bash_force_table_perms';
|
|
|
@@ -219,8 +220,8 @@ class Route_Cron extends RouteBase {
|
|
|
$groupsNetwork = UsersLdapHelper::getGroupsByID($idGroup);
|
|
|
if (empty($groupsNetwork)) throw new Exception("Group {$idGroup} not found");
|
|
|
foreach ($groupsNetwork as $vGroup) {
|
|
|
- echo "Will try to update table ".$table." set A_CLASSIFIED='".$vGroup->cn."', A_ADM_COMPANY='".$vGroup->cn."' ;" . "\n";
|
|
|
- // DB::getPDO()->execSql("update table `{$table}` set `A_CLASSIFIED`='{$vGroup->cn}', `A_ADM_COMPANY`='{$vGroup->cn}' ");
|
|
|
+ echo "Will try to update table {$table} set A_CLASSIFIED='{$vGroup->cn}', A_ADM_COMPANY='{$vGroup->cn}' ;" . "\n";
|
|
|
+ DB::getPDO()->execSql("update table `{$table}` set `A_CLASSIFIED`='{$vGroup->cn}', `A_ADM_COMPANY`='{$vGroup->cn}' ");
|
|
|
}
|
|
|
echo "DONE";
|
|
|
}
|