当前位置: 首页>>代码示例>>PHP>>正文


PHP AdminHandler::validate方法代码示例

本文整理汇总了PHP中AdminHandler::validate方法的典型用法代码示例。如果您正苦于以下问题:PHP AdminHandler::validate方法的具体用法?PHP AdminHandler::validate怎么用?PHP AdminHandler::validate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AdminHandler的用法示例。


在下文中一共展示了AdminHandler::validate方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 /**
  * Display site admin index page.
  */
 function index()
 {
     AdminHandler::validate();
     AdminHandler::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->assign('helpTopicId', 'site.index');
     $templateMgr->display('admin/index.tpl');
 }
开发者ID:alenoosh,项目名称:ojs,代码行数:11,代码来源:AdminHandler.inc.php

示例2: saveSettings

 /**
  * Validate and save changes to site settings.
  */
 function saveSettings()
 {
     parent::validate();
     parent::setupTemplate(true);
     $site =& Request::getSite();
     import('admin.form.SiteSettingsForm');
     $settingsForm =& new SiteSettingsForm();
     $settingsForm->readInputData();
     if (Request::getUserVar('uploadSiteStyleSheet')) {
         if (!$settingsForm->uploadSiteStyleSheet()) {
             $settingsForm->addError('siteStyleSheet', Locale::translate('admin.settings.siteStyleSheetInvalid'));
         }
     } elseif (Request::getUserVar('deleteSiteStyleSheet')) {
         $publicFileManager =& new PublicFileManager();
         $publicFileManager->removeSiteFile($site->getSiteStyleFilename());
     } elseif (Request::getUserVar('uploadPageHeaderTitleImage')) {
         if (!$settingsForm->uploadPageHeaderTitleImage($settingsForm->getFormLocale())) {
             $settingsForm->addError('pageHeaderTitleImage', Locale::translate('admin.settings.homeHeaderImageInvalid'));
         }
     } elseif (Request::getUserVar('deletePageHeaderTitleImage')) {
         $publicFileManager =& new PublicFileManager();
         $setting = $site->getData('pageHeaderTitleImage');
         $formLocale = $settingsForm->getFormLocale();
         if (isset($setting[$formLocale])) {
             $publicFileManager->removeSiteFile($setting[$formLocale]['uploadName']);
             unset($setting[$formLocale]);
             $site->setData('pageHeaderTitleImage', $setting);
             $siteSettingsDao =& DAORegistry::getDAO('SiteSettingsDAO');
             $siteSettingsDao->deleteSetting('pageHeaderTitleImage', $formLocale);
             // Refresh site header
             $templateMgr =& TemplateManager::getManager();
             $templateMgr->assign('displayPageHeaderTitle', $site->getSitePageHeaderTitle());
         }
     } elseif ($settingsForm->validate()) {
         $settingsForm->execute();
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign(array('currentUrl' => Request::url(null, null, 'settings'), 'pageTitle' => 'admin.siteSettings', 'message' => 'common.changesSaved', 'backLink' => Request::url(null, Request::getRequestedPage()), 'backLinkLabel' => 'admin.siteAdmin'));
         $templateMgr->display('common/message.tpl');
         exit;
     }
     $settingsForm->display();
 }
开发者ID:Jouper,项目名称:jouper,代码行数:45,代码来源:AdminSettingsHandler.inc.php

示例3: import

 /**
  * Import data from an OJS 1.x journal.
  */
 function doImportOJS1()
 {
     parent::validate();
     import('admin.form.ImportOJS1Form');
     $importForm =& new ImportOJS1Form();
     $importForm->readInputData();
     if ($importForm->validate() && ($journalId = $importForm->execute()) !== false) {
         $redirects = $importForm->getRedirects();
         $conflicts = $importForm->getConflicts();
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign('journalId', $journalId);
         $templateMgr->assign('redirects', $redirects);
         $templateMgr->assign('conflicts', $conflicts);
         $templateMgr->display('admin/importComplete.tpl');
     } else {
         parent::setupTemplate(true);
         $importForm->display();
     }
 }
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:22,代码来源:AdminJournalHandler.inc.php

示例4: mergeUsers

 /**
  * Allow the Site Administrator to merge user accounts, including attributed articles etc.
  */
 function mergeUsers($args)
 {
     parent::validate();
     parent::setupTemplate(true);
     $roleDao =& DAORegistry::getDAO('RoleDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $templateMgr =& TemplateManager::getManager();
     $oldUserId = Request::getUserVar('oldUserId');
     $newUserId = Request::getUserVar('newUserId');
     if (!empty($oldUserId) && !empty($newUserId)) {
         // Both user IDs have been selected. Merge the accounts.
         $articleDao =& DAORegistry::getDAO('ArticleDAO');
         foreach ($articleDao->getArticlesByUserId($oldUserId) as $article) {
             $article->setUserId($newUserId);
             $articleDao->updateArticle($article);
             unset($article);
         }
         $commentDao =& DAORegistry::getDAO('CommentDAO');
         foreach ($commentDao->getCommentsByUserId($oldUserId) as $comment) {
             $comment->setUserId($newUserId);
             $commentDao->updateComment($comment);
             unset($comment);
         }
         $articleNoteDao =& DAORegistry::getDAO('ArticleNoteDAO');
         $articleNotes =& $articleNoteDao->getArticleNotesByUserId($oldUserId);
         while ($articleNote =& $articleNotes->next()) {
             $articleNote->setUserId($newUserId);
             $articleNoteDao->updateArticleNote($articleNote);
             unset($articleNote);
         }
         $editAssignmentDao =& DAORegistry::getDAO('EditAssignmentDAO');
         $editAssignments =& $editAssignmentDao->getEditAssignmentsByUserId($oldUserId);
         while ($editAssignment =& $editAssignments->next()) {
             $editAssignment->setEditorId($newUserId);
             $editAssignmentDao->updateEditAssignment($editAssignment);
             unset($editAssignment);
         }
         $editorSubmissionDao =& DAORegistry::getDAO('EditorSubmissionDAO');
         $editorSubmissionDao->transferEditorDecisions($oldUserId, $newUserId);
         $reviewAssignmentDao =& DAORegistry::getDAO('ReviewAssignmentDAO');
         foreach ($reviewAssignmentDao->getReviewAssignmentsByUserId($oldUserId) as $reviewAssignment) {
             $reviewAssignment->setReviewerId($newUserId);
             $reviewAssignmentDao->updateReviewAssignment($reviewAssignment);
             unset($reviewAssignment);
         }
         $copyeditorSubmissionDao =& DAORegistry::getDAO('CopyeditorSubmissionDAO');
         $copyeditorSubmissions =& $copyeditorSubmissionDao->getCopyeditorSubmissionsByCopyeditorId($oldUserId);
         while ($copyeditorSubmission =& $copyeditorSubmissions->next()) {
             $copyeditorSubmission->setCopyeditorId($newUserId);
             $copyeditorSubmissionDao->updateCopyeditorSubmission($copyeditorSubmission);
             unset($copyeditorSubmission);
         }
         $layoutEditorSubmissionDao =& DAORegistry::getDAO('LayoutEditorSubmissionDAO');
         $layoutEditorSubmissions =& $layoutEditorSubmissionDao->getSubmissions($oldUserId);
         while ($layoutEditorSubmission =& $layoutEditorSubmissions->next()) {
             $layoutAssignment =& $layoutEditorSubmission->getLayoutAssignment();
             $layoutAssignment->setEditorId($newUserId);
             $layoutEditorSubmissionDao->updateSubmission($layoutEditorSubmission);
             unset($layoutAssignment);
             unset($layoutEditorSubmission);
         }
         $proofreaderSubmissionDao =& DAORegistry::getDAO('ProofreaderSubmissionDAO');
         $proofreaderSubmissions =& $proofreaderSubmissionDao->getSubmissions($oldUserId);
         while ($proofreaderSubmission =& $proofreaderSubmissions->next()) {
             $proofAssignment =& $proofreaderSubmission->getProofAssignment();
             $proofAssignment->setProofreaderId($newUserId);
             $proofreaderSubmissionDao->updateSubmission($proofreaderSubmission);
             unset($proofAssignment);
             unset($proofreaderSubmission);
         }
         $articleEmailLogDao =& DAORegistry::getDAO('ArticleEmailLogDAO');
         $articleEmailLogDao->transferArticleLogEntries($oldUserId, $newUserId);
         $articleEventLogDao =& DAORegistry::getDAO('ArticleEventLogDAO');
         $articleEventLogDao->transferArticleLogEntries($oldUserId, $newUserId);
         $articleCommentDao =& DAORegistry::getDAO('ArticleCommentDAO');
         foreach ($articleCommentDao->getArticleCommentsByUserId($oldUserId) as $articleComment) {
             $articleComment->setAuthorId($newUserId);
             $articleCommentDao->updateArticleComment($articleComment);
             unset($articleComment);
         }
         $accessKeyDao =& DAORegistry::getDAO('AccessKeyDAO');
         $accessKeyDao->transferAccessKeys($oldUserId, $newUserId);
         // Delete the old user and associated info.
         $sessionDao =& DAORegistry::getDAO('SessionDAO');
         $sessionDao->deleteSessionsByUserId($oldUserId);
         $subscriptionDao =& DAORegistry::getDAO('SubscriptionDAO');
         $subscriptionDao->deleteSubscriptionsByUserId($oldUserId);
         $temporaryFileDao =& DAORegistry::getDAO('TemporaryFileDAO');
         $temporaryFileDao->deleteTemporaryFilesByUserId($oldUserId);
         $notificationStatusDao =& DAORegistry::getDAO('NotificationStatusDAO');
         $notificationStatusDao->deleteNotificationStatusByUserId($oldUserId);
         $userSettingsDao =& DAORegistry::getDAO('UserSettingsDAO');
         $userSettingsDao->deleteSettings($oldUserId);
         $groupMembershipDao =& DAORegistry::getDAO('GroupMembershipDAO');
         $groupMembershipDao->deleteMembershipByUserId($oldUserId);
         $sectionEditorsDao =& DAORegistry::getDAO('SectionEditorsDAO');
         $sectionEditorsDao->deleteEditorsByUserId($oldUserId);
//.........这里部分代码省略.........
开发者ID:alenoosh,项目名称:ojs,代码行数:101,代码来源:AdminPeopleHandler.inc.php

示例5: downloadLocale

 /**
  * Download a locale from the PKP web site.
  */
 function downloadLocale()
 {
     parent::validate();
     $locale = Request::getUserVar('locale');
     import('i18n.LanguageAction');
     $languageAction =& new LanguageAction();
     if (!$languageAction->isDownloadAvailable()) {
         Request::redirect(null, null, 'languages');
     }
     if (!preg_match('/^[a-z]{2}_[A-Z]{2}$/', $locale)) {
         Request::redirect(null, null, 'languages');
     }
     $templateMgr =& TemplateManager::getManager();
     $errors = array();
     if (!$languageAction->downloadLocale($locale, $errors)) {
         $templateMgr->assign('errors', $errors);
         $templateMgr->display('admin/languageDownloadErrors.tpl');
         return;
     }
     $templateMgr->assign('messageTranslated', Locale::translate('admin.languages.localeInstalled', array('locale' => $locale)));
     $templateMgr->assign('backLink', Request::url(null, null, 'languages'));
     $templateMgr->assign('backLinkLabel', 'admin.languages.languageSettings');
     $templateMgr->display('common/message.tpl');
 }
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:27,代码来源:AdminLanguagesHandler.inc.php

示例6: validate

 /**
  * Validate the request. If a category ID is supplied, the category object
  * will be fetched and validated against. If,
  * additionally, the user ID is supplied, the user and membership
  * objects will be validated and fetched.
  * @param $categoryId int optional
  */
 function validate($categoryId = null)
 {
     parent::validate();
     $passedValidation = true;
     $categoryDao =& DAORegistry::getDAO('CategoryDAO');
     $this->categoryControlledVocab =& $categoryDao->build();
     if ($categoryId !== null) {
         $categoryEntryDao =& $categoryDao->getEntryDAO();
         $category =& $categoryEntryDao->getById($categoryId, $this->categoryControlledVocab->getId());
         if (!$category) {
             $passedValidation = false;
         } else {
             $this->category =& $category;
         }
     } else {
         $this->category = null;
     }
     if (!$passedValidation) {
         Request::redirect(null, null, 'categories');
     }
     return true;
 }
开发者ID:reconciler,项目名称:ojs,代码行数:29,代码来源:AdminCategoriesHandler.inc.php

示例7: clearDataCache

 /**
  * Clear the data cache.
  */
 function clearDataCache()
 {
     parent::validate();
     // Clear the CacheManager's caches
     import('cache.CacheManager');
     $cacheManager =& CacheManager::getManager();
     $cacheManager->flush();
     // Clear ADODB's cache
     $userDao =& DAORegistry::getDAO('UserDAO');
     // As good as any
     $userDao->flushCache();
     Request::redirect(null, 'admin');
 }
开发者ID:alenoosh,项目名称:ojs,代码行数:16,代码来源:AdminFunctionsHandler.inc.php

示例8: forcePasswordChange

 /**
  * Force all users to change their passwords on log in
  */
 function forcePasswordChange()
 {
     parent::validate();
     import('user.UserDAO');
     $userDao =& DAORegistry::getDAO('UserDAO');
     $userDao->forceChangePassword();
     Request::redirect(null, 'admin');
 }
开发者ID:LiteratimBi,项目名称:jupitertfn,代码行数:11,代码来源:AdminFunctionsHandler.inc.php

示例9: deleteAuthSource

 /**
  * Delete an authentication source.
  */
 function deleteAuthSource($args)
 {
     parent::validate();
     $authId = (int) @$args[0];
     $authDao =& DAORegistry::getDAO('AuthSourceDAO');
     $authDao->deleteSource($authId);
     Request::redirect(null, null, 'auth');
 }
开发者ID:Jouper,项目名称:jouper,代码行数:11,代码来源:AuthSourcesHandler.inc.php


注:本文中的AdminHandler::validate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。