private function showLoginForm($sLogin, $sUrlRedirect, $bRememberMe, $sError = false) { //display login form $sFormAction = AnwUtils::alink("login"); $this->out .= $this->tpl()->loginForm($sFormAction, $sLogin, $sUrlRedirect, $bRememberMe, AnwSessions::isResumeEnabled(), $sError); $this->headJsOnload($this->tpl()->loginFormJs()); }
function run() { $sDirToDelete = $this->getActionInstall()->getMyComponentPathDefault(); $sLinkHome = AnwUtils::link(AnwComponent::globalCfgHomePage()); $sLinkEditConfig = AnwUtils::alink('editconfig'); $sWebsite = '<a href="' . ANWIKI_WEBSITE . '" target="_blank">' . ANWIKI_WEBSITE . '</a>'; $this->out .= $this->tpl()->showFinished($sDirToDelete, $sLinkHome, $sLinkEditConfig, $sWebsite); //lock install $asInstallInfo = array('install_timehuman' => date("Y-m-d H:i:s"), 'install_time' => time(), 'install_version_id' => ANWIKI_VERSION_ID, 'install_version_name' => ANWIKI_VERSION_NAME); AnwUtils::putFileSerializedObject(ANWIKI_INSTALL_LOCK, $asInstallInfo); }
function run() { if (!self::globalCfgUsersRegisterEnabled()) { AnwUtils::redirect(); } $this->setTitle($this->t_('title')); $sError = false; $sLogin = ""; $sDisplayName = ""; $sEmail = ""; if (AnwEnv::_POST("submit")) { $sLogin = AnwEnv::_POST("login", ""); $sDisplayName = AnwEnv::_POST("displayname", ""); $sEmail = AnwEnv::_POST("email", ""); $sPassword = AnwEnv::_POST("password", ""); //try to register try { $this->checkCaptcha(); $sLang = AnwCurrentSession::getLang(); $nTimezone = AnwCurrentSession::getTimezone(); $oUser = AnwUsers::createUser($sLogin, $sDisplayName, $sEmail, $sLang, $nTimezone, $sPassword); AnwCurrentSession::login($sLogin, $sPassword, false); //open a public time-limited session $this->redirectInfo(false, $this->t_("t_created"), $this->t_("p_created")); } catch (AnwLoginAlreadyTakenException $e) { $sError = $this->g_("err_loginalreadytaken"); } catch (AnwBadLoginException $e) { $sError = $this->g_("err_badlogin"); } catch (AnwDisplayNameAlreadyTakenException $e) { $sError = $this->g_("err_displaynamealreadytaken"); } catch (AnwBadDisplayNameException $e) { $sError = $this->g_("err_baddisplayname"); } catch (AnwEmailAlreadyTakenException $e) { $sError = $this->g_("err_emailalreadytaken"); } catch (AnwBadEmailException $e) { $sError = $this->g_("err_bademail"); } catch (AnwBadPasswordException $e) { $sError = $this->g_("err_badpassword"); } catch (AnwBadCaptchaException $e) { $sError = $this->g_("err_badcaptcha"); } } //display register form $this->out .= $this->tpl()->registerForm(AnwUtils::alink("register"), $sLogin, $sDisplayName, $sEmail, $sError); }
private function doReauthForm() { self::debug("Showing reauth form."); $asParams = $_GET; $sFormAction = AnwUtils::alink($this->getName(), $asParams); $sDisplayName = AnwCurrentSession::getSession()->getUser()->getDisplayName(); $this->out = $this->tpl()->reauthForm($sFormAction, $sDisplayName); $this->headJsOnload($this->tpl()->reauthFormJs()); $this->output(); }
function showHtml($aoChanges, $amAllChangeTypes, $amDisplayChangeTypes, $asAllLangs, $asDisplayLangs, $asAllClasses, $asDisplayClasses, $nStartPrev, $nStartNext, $sTitle, $bGrouped, $oPage, $oPageGroup) { $this->out .= $this->tpl()->lastchangesHeader($sTitle); $sUrl = AnwEnv::_SERVER('REQUEST_URI'); $sUrl = preg_replace("/&s=([0-9]*)/", "", $sUrl); //rss link $sRssLink = $sUrl; $sRssLink .= '&feed=rss2'; //without start $this->head($this->tpl()->headRss($sRssLink)); $this->out .= $this->tpl()->filterBefore($this->linkMe()); $nPageId = $oPage ? $oPage->getId() : null; $nPageGroupId = $oPageGroup ? $oPageGroup->getId() : null; $bShowHistoryColumn = $oPage ? false : true; //disable filters if a page is selected if (!$nPageId) { //filter lang $this->out .= $this->tpl()->filterLangs($asAllLangs, $asDisplayLangs); } if (!$nPageId && !$nPageGroupId) { //filter contentclass $this->out .= $this->tpl()->filterClass($asAllClasses, $asDisplayClasses); } //filter changes types $this->out .= $this->tpl()->filterChangeTypes($amAllChangeTypes, $amDisplayChangeTypes); //display mode $sHistoryPageGroupLink = false; if ($oPage && AnwCurrentSession::isActionGlobalAllowed($this->getName())) { $sHistoryPageGroupLink = AnwEnv::_SERVER('REQUEST_URI'); $sHistoryPageGroupLink = preg_replace("\$&page=([0-9]*)\$", "", $sHistoryPageGroupLink); $sHistoryPageGroupLink = preg_replace("\$&pagegroup=([0-9]*)\$", "", $sHistoryPageGroupLink); $sHistoryPageGroupLink .= '&pagegroup=' . $oPage->getPageGroup()->getId(); } $this->out .= $this->tpl()->filterAfter($bGrouped, $nPageId, $nPageGroupId, $sRssLink, $sHistoryPageGroupLink); //nav $sLatestLink = ""; $sPrevLink = ""; if ($nStartPrev >= 0) { $sPrevLink = $sUrl . '&s=' . $nStartPrev; if ($nStartPrev > 0) { $sLatestLink = $sUrl . '&s=0'; } } $sNextLink = $sUrl . '&s=' . $nStartNext; $this->out .= $this->tpl()->nav($sLatestLink, $sPrevLink, $sNextLink, $bShowHistoryColumn); foreach ($aoChanges as $i => $oChange) { $sType = AnwChange::changeTypei18n($oChange->getType()); //links $sLnkPage = '<span class="pageid">#' . $oChange->getPageId() . '</span>'; $sLnkDiff = '-'; if ($oChange->activePageExists()) { $sLnkPage = $oChange->getActivePage()->link(); //active link, if it exists } //diffs link if ($oChange->isGlobalAndViewActionAllowed('diff')) { if ($oChange->isDiffAvailable()) { $sImgDiff = AnwUtils::xQuote(AnwUtils::pathImg("diff.gif")); $sAltDiff = AnwUtils::xQuote(self::g_("change_diff_link")); $sLnkDiff = AnwUtils::xQuote(AnwUtils::alink("diff", array("page" => $oChange->getPageId(), "revto" => $oChange->getChangeId()))); $sLnkDiff = <<<EOF <a href="{$sLnkDiff}" title="{$sAltDiff}"><img src="{$sImgDiff}" alt="{$sAltDiff}"/></a> EOF; } } //history link $sLnkHistory = false; if ($bShowHistoryColumn) { $sLnkHistory = " - "; if ($oChange->isActionAllowed('history')) { $sImgHistory = AnwUtils::xQuote(AnwUtils::pathImg("history.gif")); $sAltHistory = AnwUtils::xQuote($this->t_("change_history_link")); $sLnkHistory = AnwUtils::xQuote(AnwUtils::alink("lastchanges", array("page" => $oChange->getPageId()))); $sLnkHistory = <<<EOF <a href="{$sLnkHistory}" title="{$sAltHistory}"><img src="{$sImgHistory}" alt="{$sAltHistory}"/></a> EOF; } } //revert link $sLnkRevert = " - "; if ($oChange->isGlobalAndViewActionAllowed('revert')) { if ($oChange->isRevertAvailable()) { $sImgRevert = AnwUtils::xQuote(AnwUtils::pathImg("revert.gif")); $sAltRevert = AnwUtils::xQuote(self::t_("change_revert_link")); $sLnkRevert = AnwUtils::xQuote(AnwUtils::alink("revert", array("page" => $oChange->getPageId(), "revto" => $oChange->getChangeId()))); //we pass pageid instead of pagegroupid for better performances... $sLnkRevert = <<<EOF <a href="{$sLnkRevert}" title="{$sAltRevert}"><img src="{$sImgRevert}" alt="{$sAltRevert}"/></a> EOF; } } //output $this->out .= $this->tpl()->lastchangesLine(Anwi18n::dateTime($oChange->getTime()), $sType, $oChange->getComment(), $oChange->getInfo(), $oChange->getUser()->getDisplayName(), $sLnkPage, $sLnkDiff, $sLnkHistory, $sLnkRevert, $oChange->getPageName(), $oChange->getPageLang()); } $this->out .= $this->tpl()->lastchangesFooter(); }
protected function linkMe($asParams = array()) { return AnwUtils::alink($this->getName(), $asParams); }
function showCaptcha() { $sActionName = AnwAction::getCurrentActionName(); $asParams = array(AnwAction::GET_CAPTCHA => 1, "t" => time()); $sActionUrl = AnwUtils::alink($sActionName, $asParams); $HTML = <<<EOF {$this->g_('captcha_copy', array('code' => '<img src="' . $sActionUrl . '" alt=""/>', 'input' => '<input type="text" name="captcha" value="" class="intext captcha" maxlength="4"/>'))} EOF; return $HTML; }
protected function getEditionForm() { if (!$this->oEditionForm) { $oEditableComponent = $this->getComponent(); $amParameters = array('c' => $this->sComponentName, 't' => $this->sComponentType); $sTarget = AnwUtils::alink($this->getName(), $amParameters); $this->oEditionForm = new AnwStructuredContentEditionFormSettings($oEditableComponent, $oEditableComponent->getConfigurableContent(), $sTarget); } return $this->oEditionForm; }
function run() { AnwUtils::redirect(AnwUtils::alink("lastchanges", array("page" => $this->getoPage()->getId()))); }
function __construct($oActionGlobal, $sTitle, $sImg) { parent::__construct($sTitle, AnwUtils::alink($oActionGlobal->getName()), $sImg); $this->sActionName = $oActionGlobal->getName(); }