Exemplo n.º 1
0
                            if ($i > $server['archDepth']) {
                                unset($files[$key]);
                            }
                        }
                    }
                    $folder = getServersTaskFolder($server['id'], $taskId);
                    echo "folder = {$folder} \n";
                    foreach ($files as $file) {
                        if (!checkArchFile($folder, $file)) {
                            echo "> file = " . $file['name'] . " \n";
                            $fileData = $query->downloadFile($taskId, $file['name']);
                            if ($fileData) {
                                file_put_contents($folder . '/' . $file['name'], $fileData);
                            }
                        }
                    }
                    delOldFiles($folder, $server['archDepth']);
                }
                // ----------------------------------
            }
        } else {
            echo "\n status = " . $info['responseStatus'] . "\n";
            $serversList->data[$key]['lastCheck'] = time();
            $serversList->data[$key]['status'] = 3;
        }
    }
}
$serversList->saveToFile(__serversdb);
echo "Servers Service finished [" . date('d.m.Y h:i', time()) . "] \n";
unLock('servers');
Exemplo n.º 2
0
            if ($currentModified < $modified) {
                $modified = $currentModified;
                $removeVersion = $version;
            }
        }
        $db = eZDB::instance();
        $db->begin();
        $removeVersion->removeThis();
        $version = $object->createNewVersionIn($toLanguageCode, $fromLanguageCode, false, true, eZContentObjectVersion::STATUS_DRAFT);
        $db->commit();
        unLock($object);
        return $Module->redirect('content', 'edit', array($objectId, $version->attribute('version'), $toLanguageCode, $fromLanguageCode));
    } else {
        $http->setSessionVariable('ExcessVersionHistoryLimit', true);
        $currentVersion = $object->attribute('current_version');
        unLock($object);
        return $Module->redirect('content', 'history', array($objectId, $currentVersion, $toLanguageCode));
    }
}
function lock(eZContentObject $object)
{
    while (true) {
        if (isLocked($object)) {
            sleep(1);
        } else {
            break;
        }
    }
    $rowPending = array('action' => 'creating_translation', 'param' => $object->attribute('id'));
    $pendingItem = new eZPendingActions($rowPending);
    $pendingItem->store();
Exemplo n.º 3
0
<?php

include_once "session.php";
if ($_POST["action"] == "driverNewpass") {
    $dID = $_POST['dID'];
    $pass = gPassword();
    $query = "UPDATE drivers SET \n\t\t\t\tdPassword ='******'\n\t\t\t\tWHERE dID='{$dID}'";
    $db->query($query);
    echo "New Password " . $pass;
}
if ($_POST['action'] == "unlockDriver") {
    unLock($_POST['dID']);
}
if ($_POST['action'] == "retireDriver") {
    retireDriver($_POST['dID'], $_POST['step']);
}
if ($_POST["action"] == "submitDriverEdit") {
    $dID = $_POST['dID'];
    $fName = $_POST['fName'];
    $lName = $_POST['lName'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $license = $_POST['license'];
    $make = $_POST['make'];
    $model = $_POST['model'];
    $year = $_POST['year'];
    $tag = $_POST['tag'];
    $insurance = $_POST['insurance'];
    $policyNumber = $_POST['policyNumber'];
    $delNotes = $_POST['delNotes'];
    $schedule = $_POST['schedule'];
Exemplo n.º 4
0
                        $tasksList->data[$key]['status'] = 0;
                    }
                    // disable the task
                }
                break;
            case 'mysql_backup':
                $res = 0;
                $tasksList->data[$key]['execStatus'] = 0;
                try {
                    $res = mysqlBackup($task);
                } catch (Exception $e) {
                    echo $e->getMessage() . "\n";
                    $tasksList->data[$key]['execStatus'] = 2;
                }
                echo "{$res} \n";
                if ($res == 'Ok') {
                    $tasksList->data[$key]['lastExec'] = time();
                    // if task have to execute only once
                    if ($tasksList->data[$key]['frequency']['type'] == 'n-once') {
                        $tasksList->data[$key]['status'] = 0;
                    }
                    // disable the task
                }
                break;
        }
    }
}
$tasksList->saveToFile(__taskdb);
echo "Service finished [" . date('d.m.Y h:i', time()) . "] \n";
unLock('tasks');