0 and sstatus='verzoek tot vrijgeven' and project=" . $project['id'] . " order by id desc limit 1"); if (is_array($log_user_project)) { // Detect timestamp last request $log_user = db_fetch("log_gebruiker", "tijd", "id=" . $log_user_project[0]['id']); if (is_array($log_user)) { // Time exceeds 3 times the Power management timeout? => sstatus becomes "not released" => The devices can rest if ((convert_datetime(date("Y-m-d H:i:s")) - convert_datetime($log_user[0]['tijd'])) > (3 * PM_TIMEOUT)) { // Update project sstatus $project['sstatus'] = "niet vrijgegeven"; // Update project (only sstatus of parent (and equipment), no users/equipment, no mail) db_update_project($project, 0, array("sstatus"), "", $dummy, FALSE); // Debug info DBG("Release check: sstatus project: " . $project['naam'] . " (id: " . $project['id'] . ") => \"not released\""); // Retrieve switching equipment active (on all periods)? $equipment = db_fetch_project_lances($project['id'], "", array("kortsluiting schakelen")); if (is_array($equipment)) { foreach($equipment as $item) { // Be sure the power management state is enabled => sync => release tcpclient_sync($item['id'], FALSE, "release"); // Debug info DBG("Release check: sync equipment: " . $item['idcode'] . ""); } } } } } } } // Set handled flag $handled = 1; ?>