public function update() { $this->csrf->check(); $updated = false; $updated |= $this->updateAccessValue(); $updated |= $this->updateProjectAdminValue(); if ($updated) { $this->response->addFeedback(Feedback::INFO, $GLOBALS['Language']->getText('admin_main', 'successfully_updated')); } $this->redirectToIndex(); }
private function moveUploadedLogo() { if (!isset($_FILES['logo'])) { return; } $uploaded_logo = $_FILES['logo']; switch ($uploaded_logo['error']) { case UPLOAD_ERR_OK: continue; break; case UPLOAD_ERR_NO_FILE: return; break; case UPLOAD_ERR_INI_SIZE: case UPLOAD_ERR_FORM_SIZE: $this->response->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('admin_main', 'logo_too_big')); return; break; default: $this->response->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('admin_main', 'upload_error', $uploaded_logo['error'])); return; } $imageinfo = getimagesize($uploaded_logo['tmp_name']); if (!$imageinfo || $imageinfo['mime'] !== 'image/png') { $this->response->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('admin_main', 'no_png')); return; } $height_index = 1; if ($imageinfo[$height_index] > 100) { $this->response->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('admin_main', '100px')); return; } return move_uploaded_file($uploaded_logo['tmp_name'], Admin_Homepage_LogoFinder::getCustomPath()); }
private function checkUserIsSiteadmin(PFUser $user, Response $response) { if (!$user->isSuperUser()) { $response->addFeedback(Feedback::ERROR, $GLOBALS['Language']->getText('global', 'perm_denied')); $response->redirect('/'); } }
public function update(Codendi_Request $request, Response $response) { $emailgateway_mode = $request->get('emailgateway_mode'); if ($emailgateway_mode && $this->config->setEmailgatewayMode($emailgateway_mode)) { $response->addFeedback(Feedback::INFO, $GLOBALS['Language']->getText('admin_main', 'successfully_updated')); } $response->redirect($_SERVER['REQUEST_URI']); }
public function update(Codendi_Request $request, Response $response) { $emailgateway_mode = $request->get('emailgateway_mode'); if ($emailgateway_mode && $this->config->setEmailgatewayMode($emailgateway_mode)) { $response->addFeedback(Feedback::INFO, $GLOBALS['Language']->getText('plugin_tracker_config', 'successfully_updated')); } $this->event_manager->processEvent(Event::UPDATE_ALIASES, null); $response->redirect($_SERVER['REQUEST_URI']); }