public function execute($par) { $this->setHeaders(); $this->outputHeader(); $out = $this->getOutput(); $out->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc. $user = $this->getUser(); if ($user->isAnon()) { $out->showErrorPage('prefsnologin', 'prefsnologintext', array($this->getTitle()->getPrefixedDBkey())); return; } $this->checkReadOnly(); if ($par == 'reset') { $this->showResetForm(); return; } $out->addModules('mediawiki.special.preferences'); /* Wikia change begin - @author: macbre */ /* Enable custom notifications handling */ wfRunHooks('SpecialPreferencesOnRender', array(&$this)); /* Wikia change end */ if ($this->getRequest()->getCheck('success')) { $out->wrapWikiMsg("<div class=\"successbox\"><strong>\n\$1\n</strong></div><div id=\"mw-pref-clear\"></div>", 'savedprefs'); } if ($this->getRequest()->getCheck('eauth')) { $out->wrapWikiMsg("<div class='error' style='clear: both;'>\n\$1</div>", 'eauthentsent', $user->getName()); } $htmlForm = Preferences::getFormObject($user, $this->getContext()); $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit')); $htmlForm->show(); }
public function execute($par) { $this->setHeaders(); $this->outputHeader(); $out = $this->getOutput(); $out->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc. $this->requireLogin('prefsnologintext2'); $this->checkReadOnly(); if ($par == 'reset') { $this->showResetForm(); return; } $out->addModules('mediawiki.special.preferences'); $out->addModuleStyles('mediawiki.special.preferences.styles'); if ($this->getRequest()->getCheck('success')) { $out->wrapWikiMsg(Html::rawElement('div', array('class' => 'mw-preferences-messagebox successbox', 'id' => 'mw-preferences-success'), Html::element('p', array(), '$1')), 'savedprefs'); } $this->addHelpLink('Help:Preferences'); // Load the user from the master to reduce CAS errors on double post (T95839) $user = $this->getUser()->getInstanceForUpdate() ?: $this->getUser(); $htmlForm = Preferences::getFormObject($user, $this->getContext()); $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit')); $sectionTitles = $htmlForm->getPreferenceSections(); $prefTabs = ''; foreach ($sectionTitles as $key) { $prefTabs .= Html::rawElement('li', array('role' => 'presentation', 'class' => $key === 'personal' ? 'selected' : null), Html::rawElement('a', array('id' => 'preftab-' . $key, 'role' => 'tab', 'href' => '#mw-prefsection-' . $key, 'aria-controls' => 'mw-prefsection-' . $key, 'aria-selected' => $key === 'personal' ? 'true' : 'false', 'tabIndex' => $key === 'personal' ? 0 : -1), $htmlForm->getLegend($key))); } $out->addHTML(Html::rawElement('ul', array('id' => 'preftoc', 'role' => 'tablist'), $prefTabs)); $htmlForm->show(); }
function execute($par) { global $wgOut, $wgUser, $wgRequest; $this->setHeaders(); $this->outputHeader(); $wgOut->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc. if ($wgUser->isAnon()) { $wgOut->showErrorPage('prefsnologin', 'prefsnologintext', array($this->getTitle()->getPrefixedDBkey())); return; } if (wfReadOnly()) { $wgOut->readOnlyPage(); return; } if ($par == 'reset') { $this->showResetForm(); return; } $wgOut->addModules('mediawiki.legacy.prefs'); $wgOut->addModules('mediawiki.special.preferences'); if ($wgRequest->getCheck('success')) { $wgOut->wrapWikiMsg("<div class=\"successbox\"><strong>\n\$1\n</strong></div><div id=\"mw-pref-clear\"></div>", 'savedprefs'); } if ($wgRequest->getCheck('eauth')) { $wgOut->wrapWikiMsg("<div class='error' style='clear: both;'>\n\$1\n</div>", 'eauthentsent', $wgUser->getName()); } $htmlForm = Preferences::getFormObject($wgUser); $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit')); $htmlForm->show(); }
public function execute($par) { $this->setHeaders(); $this->outputHeader(); $out = $this->getOutput(); $out->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc. $user = $this->getUser(); if ($user->isAnon()) { $out->showErrorPage('prefsnologin', 'prefsnologintext', array($this->getTitle()->getPrefixedDBkey())); return; } $this->checkReadOnly(); if ($par == 'reset') { $this->showResetForm(); return; } $out->addModules('mediawiki.special.preferences'); if ($this->getRequest()->getCheck('success')) { $out->wrapWikiMsg("<div class=\"successbox\"><strong>\n\$1\n</strong></div><div id=\"mw-pref-clear\"></div>", 'savedprefs'); } $htmlForm = Preferences::getFormObject($user, $this->getContext()); $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit')); $htmlForm->show(); }
function execute($par) { $user = $this->getUser(); $out = $this->getOutput(); if (!$user->isAllowed('edituser')) { $out->permissionRequired('edituser'); return false; } $this->setHeaders(); $request = $this->getRequest(); $this->target = isset($par) ? $par : $request->getText('username', ''); if ($this->target === '') { $out->addHtml($this->makeSearchForm()); return; } $targetuser = User::NewFromName($this->target); if ($targetuser->getID() == 0) { $out->addWikiMsg('edituser-nouser', htmlspecialchars($this->target)); return; } $this->targetuser = $targetuser; #Allow editing self via this interface if ($targetuser->isAllowed('edituser-exempt') && $targetuser->getName() != $user->getName()) { $out->addWikiMsg('edituser-exempt', $targetuser->getName()); return; } $this->setHeaders(); $this->outputHeader(); $out->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc. if (wfReadOnly()) { $out->readOnlyPage(); return; } if ($request->getCheck('reset')) { $this->showResetForm(); return; } $out->addModules('mediawiki.special.preferences'); //$this->loadGlobals( $this->target ); $out->addHtml($this->makeSearchForm() . '<br />'); #End EditUser additions if ($request->getCheck('success')) { $out->wrapWikiMsg("<div class=\"successbox\"><strong>\n\$1\n</strong></div><div id=\"mw-pref-clear\"></div>", 'savedprefs'); } if ($request->getCheck('eauth')) { $out->wrapWikiMsg("<div class='error' style='clear: both;'>\n\$1\n</div>", 'eauthentsent', $this->target); } $htmlForm = Preferences::getFormObject($targetuser, $this->getContext(), 'EditUserPreferencesForm', array('password')); $htmlForm->setSubmitCallback('Preferences::tryUISubmit'); $htmlForm->addHiddenField('username', $this->target); $htmlForm->show(); }
public function execute($par) { $this->setHeaders(); $this->outputHeader(); $out = $this->getOutput(); $out->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc. $this->requireLogin('prefsnologintext2'); $this->checkReadOnly(); if ($par == 'reset') { $this->showResetForm(); return; } $out->addModules('mediawiki.special.preferences'); if ($this->getRequest()->getCheck('success')) { $out->wrapWikiMsg("<div class=\"successbox\">\n\$1\n</div>", 'savedprefs'); } $htmlForm = Preferences::getFormObject($this->getUser(), $this->getContext()); $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit')); $htmlForm->show(); }
public function execute($par) { $this->setHeaders(); $this->outputHeader(); $out = $this->getOutput(); $out->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc. $this->requireLogin('prefsnologintext2'); $this->checkReadOnly(); if ($par == 'reset') { $this->showResetForm(); return; } $out->addModules('mediawiki.special.preferences'); if ($this->getRequest()->getCheck('success')) { $out->wrapWikiMsg(Html::rawElement('div', array('class' => 'mw-preferences-messagebox successbox', 'id' => 'mw-preferences-success'), Html::element('p', array(), '$1')), 'savedprefs'); } $this->addHelpLink('Help:Preferences'); $htmlForm = Preferences::getFormObject($this->getUser(), $this->getContext()); $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit')); $htmlForm->show(); }
public function execute($par) { $this->setHeaders(); $this->outputHeader(); $out = $this->getOutput(); $out->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc. $this->requireLogin('prefsnologintext2'); $this->checkReadOnly(); if ($par == 'reset') { $this->showResetForm(); return; } $out->addModules('mediawiki.special.preferences'); $out->addModuleStyles('mediawiki.special.preferences.styles'); $session = $this->getRequest()->getSession(); if ($session->get('specialPreferencesSaveSuccess')) { // Remove session data for the success message $session->remove('specialPreferencesSaveSuccess'); $out->addModuleStyles('mediawiki.notification.convertmessagebox.styles'); $out->addHTML(Html::rawElement('div', ['class' => 'mw-preferences-messagebox mw-notify-success successbox', 'id' => 'mw-preferences-success', 'data-mw-autohide' => 'false'], Html::element('p', [], $this->msg('savedprefs')->text()))); } $this->addHelpLink('Help:Preferences'); // Load the user from the master to reduce CAS errors on double post (T95839) if ($this->getRequest()->wasPosted()) { $user = $this->getUser()->getInstanceForUpdate() ?: $this->getUser(); } else { $user = $this->getUser(); } $htmlForm = Preferences::getFormObject($user, $this->getContext()); $htmlForm->setSubmitCallback(['Preferences', 'tryUISubmit']); $sectionTitles = $htmlForm->getPreferenceSections(); $prefTabs = ''; foreach ($sectionTitles as $key) { $prefTabs .= Html::rawElement('li', ['role' => 'presentation', 'class' => $key === 'personal' ? 'selected' : null], Html::rawElement('a', ['id' => 'preftab-' . $key, 'role' => 'tab', 'href' => '#mw-prefsection-' . $key, 'aria-controls' => 'mw-prefsection-' . $key, 'aria-selected' => $key === 'personal' ? 'true' : 'false', 'tabIndex' => $key === 'personal' ? 0 : -1], $htmlForm->getLegend($key))); } $out->addHTML(Html::rawElement('ul', ['id' => 'preftoc', 'role' => 'tablist'], $prefTabs)); $htmlForm->show(); }