public function handleGet($get, $post, $files, $cookies)
 {
     if (Models\User::currentUser($cookies)->authorizationLevel < 5) {
         throw new \Exception('You are not authorized to view this page');
     }
     $results = Models\Folder::update();
     /* Set up the page view */
     $view = new Views\AdminRescanView();
     $view->scanResults = $results;
     $view->thumbnailUrl = AdminThumbnailController::getUrl();
     $this->htmlHeader($cookies);
     $view->render();
     $this->htmlFooter();
 }
Ejemplo n.º 2
0
 public function handleGet($get, $post, $files, $cookies)
 {
     if (Models\User::currentUser($cookies)->authorizationLevel < 5) {
         throw new \Exception('You are not authorized to view this page');
     }
     /* Set up the page view */
     $view = new Views\AdminView();
     $view->runningVersion = constant('CAMERALIFE_VERSION');
     $view->latestVersion = $this->latestAvailableVersion();
     $checkpointLogs = intval(Models\Preferences::valueForModuleWithKey('CameraLife', 'checkpointlogs'));
     $view->numNewLogs = Models\Database::selectOne('logs', 'COUNT(*)', 'id>' . $checkpointLogs);
     $checkpointComments = intval(Models\Preferences::valueForModuleWithKey('CameraLife', 'checkpointcomments'));
     $view->numNewComments = Models\Database::selectOne('comments', 'COUNT(*)', 'id>' . $checkpointComments);
     $view->numNewUsers = Models\Database::selectOne('users', 'COUNT(*)', 'auth=1');
     $view->numFlagged = Models\Database::selectOne('photos', 'COUNT(*)', 'status=1');
     $view->appearanceUrl = AdminAppearanceController::getUrl();
     $view->logsUrl = AdminLogsController::getUrl();
     $view->commentsUrl = AdminCommentsController::getUrl();
     $view->fileStoreUrl = AdminFileStoreController::getUrl();
     $view->securityUrl = AdminSecurityController::getUrl();
     $view->thumbnailUrl = AdminThumbnailController::getUrl();
     $view->rescanUrl = AdminRescanController::getUrl();
     $view->photosUrl = AdminPhotosController::getUrl();
     $preferences = array();
     $preferences[] = ['module' => 'CameraLife', 'key' => 'sitename', 'type' => 'string', 'name' => 'Site name'];
     $preferences[] = ['module' => 'CameraLife', 'key' => 'sitename', 'type' => 'string', 'name' => 'Site abbreviation'];
     $preferences[] = ['module' => 'CameraLife', 'key' => 'owner_email', 'type' => 'string', 'name' => 'Owner email address'];
     $preferences[] = ['module' => 'CameraLife', 'key' => 'rewrite', 'type' => 'yesno', 'name' => 'Use pretty URLs'];
     $preferences[] = ['module' => 'CameraLife', 'key' => 'autorotate', 'type' => 'yesno', 'name' => 'Autorotate photos'];
     $preferences[] = ['module' => 'CameraLife', 'key' => 'thumbsize', 'type' => 'number', 'name' => 'Size for thumbnails'];
     $preferences[] = ['module' => 'CameraLife', 'key' => 'scaledsize', 'type' => 'number', 'name' => 'Size for preview images'];
     $preferences[] = ['module' => 'CameraLife', 'key' => 'optionsizes', 'type' => 'string', 'name' => 'Other available sizes', 'help' => 'comma separated (you can also leave this blank)'];
     $view->preferences = $preferences;
     $this->htmlHeader($cookies);
     $view->render();
     $this->htmlFooter();
 }