Ejemplo n.º 1
0
function sys_lock($file, $username)
{
    if (!sys_can_lock($file)) {
        return;
    }
    file_put_contents($file . ".lck", $username, LOCK_EX);
    file_put_contents(SIMPLE_STORE . "/locking/locks.txt", $file . "\n", FILE_APPEND | LOCK_EX);
}
Ejemplo n.º 2
0
 static function file_lock($folder, $id, $field, $subitem)
 {
     self::_require_access($folder, "write", "edit");
     $filename = self::file_download($folder, "edit", $id, $field, $subitem, true);
     if (!sys_can_lock($filename)) {
         exit("{t}Access denied.{/t}");
     }
     sys_lock($filename, $_SESSION["username"]);
     return $folder;
 }