$o->UserID = $User->ID; $o->Type = 'system'; $o->Key = 'theme'; $o->Load(); $o->Data = $args->args->theme; $o->Save(); if ($o->ID > 0) { die('ok'); } die('fail'); case 'userdelete': $u = new dbIO('FUser'); if ($u->Load($args->args->id)) { $SqlDatabase->query('DELETE FROM `FSetting` WHERE UserID=\'' . $u->ID . '\''); $SqlDatabase->query('DELETE FROM `DockItem` WHERE UserID=\'' . $u->ID . '\''); $u->Delete(); die('ok'); } die('fail'); case 'usersettings': // Settings object $s = new stdClass(); // The first login test! include 'modules/system/include/firstlogin.php'; // Theme information $o = new dbIO('FSetting'); $o->UserID = $User->ID; $o->Type = 'system'; $o->Key = 'theme'; $o->Load(); $s->Theme = $o->ID > 0 ? $o->Data : false;
function deleteFile($path, $recursive = false) { global $Config, $User, $Logger; // If it's a folder if (substr($path, -1, 1) == '/') { return $this->deleteFolder($path, $recursive); } // Remove file from path $subPath = explode('/', end(explode(':', $path))); array_pop($subPath); $subPath = implode('/', $subPath) . '/'; $fo = $this->getSubFolder($subPath); $Logger->log('Trying to delete a file in folder: ' . ($fo ? $fo->Name : '(don\'t know, but in subfolder ' . $subPath . ')')); $fi = new dbIO('FSFile'); $fi->UserID = $User->ID; $fi->FilesystemID = $this->ID; $fi->FolderID = $fo ? $fo->ID : '0'; if (strstr($path, '/')) { $fi->Filename = end(explode('/', $path)); } else { $fi->Filename = end(explode(':', $path)); } if ($fi->Load()) { if (file_exists($Config->FCUpload . $fi->DiskFilename)) { $Logger->log('Deleting file in folder ' . ($fo ? $fo->Name : '') . '/ (' . $fi->FolderID . ')'); unlink($Config->FCUpload . $fi->DiskFilename); $fi->Delete(); return true; } else { $Logger->log('Deleting db only (corrupt) file in folder ' . $fi->Name . '/ (' . $fi->FolderID . ')'); $fi->Delete(); } } return false; }