本文整理汇总了PHP中messages::registerError方法的典型用法代码示例。如果您正苦于以下问题:PHP messages::registerError方法的具体用法?PHP messages::registerError怎么用?PHP messages::registerError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类messages
的用法示例。
在下文中一共展示了messages::registerError方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
$category = new \model\category($this->getDbconnection());
if (!is_null($this->getRequestVar('submupload'))) {
$newFile = new \model\file();
$icon = $newFile->uploadFile();
$category->setIconPath($icon);
}
if (!is_null($this->getRequestVar('category'))) {
$data = $this->getRequestVar('category');
foreach ($data as $key => $value) {
$data[$key] = $this->filterRequest($value, array(1, 4, 7));
}
$category->setName($data['name']);
$category->setIconPath($data['iconPath']);
$category->setIsPrivate($data['isPrivate']);
if ($category->save()) {
$this->redirect('category/list', array('categoryadded=yes'));
} else {
\messages::registerError(\language::returnLanguageConstant('SAVE_FAILED_CATEGORY'));
}
} else {
$category->setIsPrivate(0);
}
$view = new \model\view_acp('category_editor');
$view->assign('category', $category);
$view->assign('editormode', 0);
$view->assign('headlinetext', \language::returnLanguageConstant('HL_CATEGORIES_ADD'));
$view->render();
}
示例2: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
$containers = array();
$containerClassFiles = scandir(\base_config::$baseDir . '/inc/dashcontainers/');
foreach ($containerClassFiles as $containerClassFile) {
if (strpos($containerClassFile, '.php') === false) {
continue;
}
$containerClassFile = str_replace('.php', '', $containerClassFile);
$containerObject = new $containerClassFile($this);
if (is_a($containerObject, '\\interfaces\\dashcontainer')) {
$containerPosition = $containerObject->getPosition();
if (isset($containers[$containerPosition])) {
$containerPosition++;
}
$containers[$containerPosition] = new \model\dashboard_container($containerObject->getBoxName(), $containerObject->getBoxHeadline(), $containerObject->getBoxContent(), $containerObject->getSize(), $containerObject->getHeight());
} else {
$message = \language::replaceLanguageConstant(\language::returnLanguageConstant('DASH_CONTAINER_INSTANCE'), array('{{dashcontainer}}' => $containerClassFile));
\messages::registerError($message);
}
}
if (count($containers) >= 1) {
ksort($containers);
}
$view = new \model\view_acp('dashboard');
$view->assign('statsContainers', $containers);
$view->render();
}
示例3: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
$categoryId = $this->getRequestVar('categoryid', array(1, 4, 7));
if (is_null($categoryId)) {
$this->redirect('category/list');
}
$category = new \model\category($this->getDbconnection(), $categoryId);
if (!is_null($this->getRequestVar('category'))) {
$data = $this->getRequestVar('category');
foreach ($data as $key => $value) {
$data[$key] = $this->filterRequest($value, array(1, 4, 7));
}
$category->setName($data['name']);
$category->setIconPath($data['iconPath']);
$category->setIsPrivate($data['isPrivate']);
if ($category->update()) {
$this->redirect('category/list', array('categoryedited=yes'));
} else {
\messages::registerError(\language::returnLanguageConstant('SAVE_FAILED_CATEGORY'));
}
}
$view = new \model\view_acp('category_editor');
$view->assign('category', $category);
$view->assign('editormode', 1);
$view->assign('systemmode', $this->getSysconfig()->getSystemMode());
$view->assign('headlinetext', \language::returnLanguageConstant('HL_CATEGORIES_EDIT'));
$view->assign('dtMask', $this->getSysconfig()->getDateTimeMask());
$view->render();
}
示例4: process
public function process()
{
$affiliate = new \model\affiliate($this->getDbconnection());
if (!is_null($this->getRequestVar('submsave')) && !is_null($this->getRequestVar('antiSpamAnswer'))) {
if ($this->getRequestVar('antiSpamAnswer') === $this->getSysconfig()->getAntispamAnswer()) {
$data = $this->getRequestVar('affiliate');
foreach ($data as $key => $value) {
$data[$key] = $this->filterRequest($value, array(1, 4, 7));
}
$affiliate->setPageName($data['pageName']);
$affiliate->setPageUrl($data['pageUrl']);
$affiliate->setPageAdminName($data['pageAdminName']);
$affiliate->setPageAdminEmail($data['pageAdminEmail']);
$affiliate->setPageButton($data['pageButton']);
$affiliate->setAffiliateCategory($data['affiliateCategory']);
$affiliate->setAffiliateAddedTime(time());
$affiliate->setAffiliateEditedTime(0);
$affiliate->setAffiliateIsMarked(0);
$affiliate->setAffiliateIsAccpted(0);
if ($affiliate->save()) {
\messages::registerNotice(\language::returnLanguageConstant('APPLY_OK'));
$catgory = new \model\category($this->dbconnection, $affiliate->getAffiliateCategory());
$mailData = array('mailTo' => $this->getSysconfig()->getAdminMail(), 'mailSubject' => \language::replaceLanguageConstant(\language::returnLanguageConstant('APPLY_MAIL_SUBJECT'), array('{{affiliateKategory}}' => $catgory->getName())), 'mailText' => \language::replaceLanguageConstant(\language::returnLanguageConstant('APPLY_MAIL_TEXT'), array('{{name}}' => $affiliate->getPageAdminName(), '{{page}}' => $affiliate->getPageUrl(), '{{affiliateKategory}}' => $catgory->getName(), '{{acpLink}}' => \base_config::$rootPath)), 'mailFrom' => $affiliate->getPageAdminEmail());
\messages::sendEMail($mailData);
} else {
\messages::registerError(\language::returnLanguageConstant('APPLY_FAILED'));
}
$affiliate = new \model\affiliate($this->getDbconnection());
} else {
\messages::registerError(\language::returnLanguageConstant('APPLY_FAILED_SPAM'));
}
}
$categoryList = new \model\category_list($this->getDbconnection(), false);
$categories = array();
foreach ($categoryList->getCategories() as $category) {
$categories[$category->getName()] = $category->getId();
}
$view = new \model\view_public('apply_form');
$view->assign('affiliate', $affiliate);
$view->assign('categories', $categories);
$view->assign('antiSpamQuestion', $this->getSysconfig()->getAntispamQuestion());
$view->assign('isNotUtf8', $this->isNotUtf8);
$view->assign('systemVersion', $this->getSysconfig()->getSysVersion());
$view->setReturnRender($this->returnRender);
if ($this->returnRender) {
$data = $view->render();
return $data;
}
$view->render();
}
示例5: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
$file = new \model\file();
if (!unlink(\base_config::$updateCache)) {
\messages::logSystem('Unable to clear cache!');
\messages::registerError(\language::returnLanguageConstant('CACHE_CLEARED_FAILED'));
} else {
\messages::registerMessage(\language::returnLanguageConstant('CACHE_CLEARED_OK'));
}
\messages::showMessages();
die;
}
示例6: process
function process()
{
if (!is_null($this->getRequestVar('nologin'))) {
\messages::registerError(\language::returnLanguageConstant('NO_LOGIN'));
}
$sessionCookieValue = $this->getSessionCookieValue();
if (!is_null($sessionCookieValue)) {
$session = new \model\session($this->getDbconnection(), $sessionCookieValue);
if ($session->exists()) {
$session->setLogout(time());
$session->update();
setcookie('afltrsid', '', 0, '/', $_SERVER["SERVER_NAME"], false, true);
header('Location: index.php');
}
}
}
示例7: process
public function process()
{
if (!is_null($this->getRequestVar('nologin'))) {
\messages::registerError(\language::returnLanguageConstant('NO_LOGIN'));
}
if (!is_null($this->getRequestVar('nopassreset'))) {
\messages::registerError(\language::returnLanguageConstant('LOGIN_PASSWORD_RESET_FAILED'));
}
if (!is_null($this->getRequestVar('resetpass'))) {
$newPass = uniqid();
$mailData = array('mailTo' => $this->getSysconfig()->getAdminMail(), 'mailSubject' => \language::returnLanguageConstant('LOGIN_PASSWORD_RESET'), 'mailText' => $newPass, 'mailFrom' => 'affiliat_r_no_reply@' . $_SERVER['HTTP_HOST']);
if (\messages::sendEMail($mailData)) {
$this->getSysconfig()->setLoginPasswort($newPass);
$this->getSysconfig()->update();
$this->redirect();
} else {
$this->redirect('', array('nopassreset'));
}
}
$sessionCookieValue = $this->getSessionCookieValue();
if (!is_null($sessionCookieValue)) {
$session = new \model\session($this->getDbconnection(), $sessionCookieValue);
if ($session->exists()) {
$this->redirect('system/dash');
}
}
if (!is_null($this->getRequestVar('passwd', array(1, 4, 7)))) {
$passwort = \tools::createPasswordHash($this->getRequestVar('passwd'), $this->getSysconfig()->getLoginPasswortSalt());
if ($passwort == $this->getSysconfig()->getLoginPasswort()) {
$ip = $_SERVER["REMOTE_ADDR"];
$sessionId = sha1(uniqid($ip, true));
$expire = time() + $this->getSysconfig()->getSessionLength();
$session = new \model\session($this->getDbconnection());
$session->setLogin(time());
$session->setLogout(0);
$session->setSessionId($sessionId);
$session->setIp($ip);
$session->save();
setcookie('afltrsid', $sessionId, $expire, '/', $_SERVER["SERVER_NAME"], false, true);
$this->redirect('system/dash');
}
\messages::registerError(\language::returnLanguageConstant('WRONG_PASSWORD'));
}
$view = new \model\view_acp('login');
$view->assign('defaultPW', '');
$view->render();
}
示例8: process
public function process()
{
if (!parent::process()) {
$this->redirectNoSession();
}
if (!is_null($this->getRequestVar('options'))) {
$data = $this->getRequestVar('options');
$sysConfigObj = $this->getSysconfig();
if (!empty($data['loginPasswort']) && !$sysConfigObj->isPasswordSecure($data['loginPasswort'])) {
\messages::registerError(\language::returnLanguageConstant('SAVE_FAILED_PASSWORD'));
unset($data['loginPasswort']);
}
foreach ($data as $key => $value) {
if ($value == '') {
continue;
}
$fn = 'set' . $key;
$sysConfigObj->{$fn}($this->filterRequest($value, array(1, 4, 7)));
}
$sysConfigObj->update();
\messages::registerMessage(\language::returnLanguageConstant('SAVE_SUCCESS_OPTIONS'));
}
$fields = array('adminMail' => $this->getSysconfig()->getAdminMail(), 'iframecss' => $this->getSysconfig()->getIframecss(), 'sessionLength' => $this->getSysconfig()->getSessionLength(), 'timeZone' => $this->getSysconfig()->getTimeZone(), 'dateTimeMask' => $this->getSysconfig()->getDateTimeMask(), 'antispamQuestion' => $this->getSysconfig()->getAntispamQuestion(), 'antispamAnswer' => $this->getSysconfig()->getAntispamAnswer());
$dtMasksArray = array('d.m.Y', 'd. M Y', 'd.n.Y', 'j.m.Y', 'j. M Y', 'j.n.Y', 'M dS Y', 'm/d/Y', 'n/d/Y');
$dtMasks = array();
foreach ($dtMasksArray as $dtMask) {
$dtMasks[] = array('label' => $dtMask . ' (' . date($dtMask) . ')', 'value' => $dtMask);
}
$timeZones = timezone_identifiers_list();
$timeZones = array_combine(array_values($timeZones), array_values($timeZones));
unset($timeZones['UTC']);
$view = new \model\view_acp('options');
$view->assign('languages', \language::getLanguages());
$view->assign('modes', array('iframe' => 1, 'phpcinlude' => 2));
$view->assign('timeZones', array_unique($timeZones));
$view->assign('syslang', $this->getSysconfig()->getSysLanguage());
$view->assign('sysmode', $this->getSysconfig()->getSystemMode());
$view->assign('dtMasks', json_encode($dtMasks));
$view->assign('fields', $fields);
$view->render();
}
示例9: render
/**
* Prüft, ob View-Datei vorhanden ist und lädt diese
* @return bool
*/
public function render()
{
if (!defined('VIEW')) {
define('VIEW', '1');
}
$this->viewFile = $this->viewPath . $this->viewName;
if (!file_exists($this->viewFile)) {
$notFoundMessage = str_replace('{{viewname}}', $this->viewName, \language::returnLanguageConstant('VIEW_NOT_FOUND'));
\messages::registerError($notFoundMessage);
\messages::logError($notFoundMessage);
return false;
}
return true;
}
示例10: checkUpdates
/**
* Update check
* @return string
*/
private function checkUpdates()
{
$updateValue = $this->sysconfig->checkForUpdates();
if (!is_null($updateValue)) {
$updateMessage = \language::replaceLanguageConstant(\language::returnLanguageConstant('UPDATE_NOTAUTOCHECK'), array('{{versionlink}}' => $updateValue));
\messages::registerError($updateMessage, true);
\messages::registerMessage("<iframe src=\"{$updateValue}\" class=\"update-check-iframe\" scrolling=\"no\" seamless></iframe>", true);
}
}
示例11: checkForUpdates
/**
* Prüft ob Update verfügbar sind
* @return string|null
*/
public function checkForUpdates()
{
$data = array('version' => $this->getSysVersion(), 'language' => $this->getSysLanguage(), 'phpvers' => PHP_VERSION, 'isauto' => (int) \base_config::canConnect());
$url = \base_config::$updateServer . 'noauto.php?data=' . base64_encode(json_encode($data));
if (!\base_config::canConnect()) {
return $url;
}
if (file_exists(\base_config::$updateCache)) {
$updateCache = json_decode(file_get_contents(\base_config::$updateCache), true);
if ($updateCache['expire'] >= time()) {
if (!empty($updateCache['message'])) {
\messages::registerNotice($updateCache['message'], true);
}
return;
}
}
try {
$url = \base_config::$updateServer . 'newver.php?data=' . base64_encode(json_encode($data));
$updateData = fopen($url, 'r');
$updateData = fgets($updateData);
$updateData = json_decode(base64_decode($updateData), true);
$updateMessage = '';
if (version_compare($updateData['newversion'], $this->getSysVersion(), '>')) {
if (isset($updateData['forceupdate']) && $updateData['forceupdate']) {
header("Location: ?module=system/update&file=" . $updateData['updatefile']);
}
$updateMessage = \language::replaceLanguageConstant(\language::returnLanguageConstant('UPDATE_NEWVERSION'), array('{{versionlink}}' => '?module=system/update&file=' . $updateData['updatefile']));
\messages::registerNotice($updateMessage, true);
}
$cacheTmp = array('expire' => time() + 43200, 'message' => $updateMessage);
file_put_contents(\base_config::$updateCache, json_encode($cacheTmp));
} catch (\Exception $ex) {
\messages::registerError($ex->getMessage(), true);
}
return null;
}
示例12: checkRequirements
private function checkRequirements()
{
if (!class_exists('PDO')) {
\messages::registerError('PHP PDO extension not found! Unable to proceed. Contact your host!', true);
die;
}
foreach ($this->checkFolders as $checkFolder) {
if (!is_writable(\base_config::$baseDir . '/' . $checkFolder)) {
\messages::registerError("Unable to write in folder <b>/{$checkFolder}</b>!", true);
}
}
if (!\base_config::canConnect()) {
\messages::registerNotice('PHP setting <b>allow_url_fopen</b> is diabled. This is not required, but recommended.', true);
}
}
示例13: unzipPackage
public function unzipPackage($fileName, &$fileList = array())
{
$fileName = \base_config::$updateFolder . $fileName;
$zip = new \ZipArchive();
$res = $zip->open($fileName);
if ($res !== TRUE) {
\messages::logSystem($res);
\messages::registerError(\language::returnLanguageConstant('UNPACK_PCK_FAILED'), false);
return false;
}
for ($i = 0; $i < $zip->numFiles; $i++) {
$zipFileName = \base_config::$baseDir . $zip->getNameIndex($i);
if (file_exists($zipFileName) && !is_writable($zipFileName)) {
chmod($zipFileName, 0777);
}
$fileCheck = $zip->getNameIndex($i);
if (file_exists($zipFileName)) {
$fileCheck = is_writable($zipFileName) ? true : false;
} else {
$fileCheck = true;
}
$fileList[$zipFileName] = $fileCheck;
}
if ($zip->extractTo(\base_config::$updateFolder)) {
\messages::logSystem('Extract package file ' . $fileName . ' >> OK!');
\messages::registerMessage(\language::returnLanguageConstant('UNPACK_PCK_SUCCESS'), false);
}
$zip->close();
return true;
}