Skip to content

Commit da2386a

Browse files
committed
[Update] FormLister 1.8.1
1 parent 92a15c0 commit da2386a

11 files changed

Lines changed: 18 additions & 18 deletions

File tree

assets/snippets/FormLister/core/FormLister.abstract.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function __construct (\DocumentParser $modx, $cfg = array())
122122
}
123123
$this->lexicon = new Lexicon($modx, array(
124124
'langDir' => 'assets/snippets/FormLister/core/lang/',
125-
'lang' => $this->getCFGDef('lang', $this->modx->config['manager_language'])
125+
'lang' => $this->getCFGDef('lang', $this->modx->getConfig('manager_language'))
126126
));
127127
$this->DLTemplate = \DLTemplate::getInstance($modx);
128128
$this->DLTemplate->setTemplatePath($this->getCFGDef('templatePath'));
@@ -152,7 +152,7 @@ public function initForm ()
152152
{
153153
$lexicon = $this->getCFGDef('lexicon');
154154
$langDir = $this->getCFGDef('langDir', 'assets/snippets/FormLister/core/lang/');
155-
$lang = $this->getCFGDef('lang', $this->modx->config['manager_language']);
155+
$lang = $this->getCFGDef('lang', $this->modx->getConfig('manager_language'));
156156
if ($lexicon) {
157157
$_lexicon = $this->config->loadArray($lexicon);
158158
if (isset($_lexicon[0])) {
@@ -1128,7 +1128,7 @@ public function redirect ($param = 'redirectTo', $_query = array())
11281128
if (isset($redirect['header'])) {
11291129
$header = $redirect['header'];
11301130
}
1131-
$page = isset($redirect['page']) ? $redirect['page'] : $this->modx->config['site_start'];
1131+
$page = isset($redirect['page']) ? $redirect['page'] : $this->modx->getConfig('site_start');
11321132
}
11331133
if (is_numeric($page)) {
11341134
$redirect = $this->modx->makeUrl($page, '', $query, 'full');

assets/snippets/FormLister/core/controller/Form.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public function __construct(\DocumentParser $modx, array $cfg = array())
3737
$this->mailConfig = array(
3838
'isHtml' => $this->getCFGDef('isHtml', 1),
3939
'to' => $this->getCFGDef('to'),
40-
'from' => $this->getCFGDef('from', $this->modx->config['emailsender']),
41-
'fromName' => $this->getCFGDef('fromName', $this->modx->config['site_name']),
40+
'from' => $this->getCFGDef('from', $this->modx->getConfig('emailsender')),
41+
'fromName' => $this->getCFGDef('fromName', $this->modx->getConfig('site_name')),
4242
'subject' => $this->getCFGDef('subject'),
4343
'replyTo' => $this->getCFGDef('replyTo'),
4444
'cc' => $this->getCFGDef('cc'),
@@ -442,7 +442,7 @@ public function getMailSendConfig($to, $fromParam, $subjectParam = 'subject')
442442
array(
443443
'subject' => $subject,
444444
'to' => $to,
445-
'fromName' => $this->getCFGDef($fromParam, $this->modx->config['site_name'])
445+
'fromName' => $this->getCFGDef($fromParam, $this->modx->getConfig('site_name'))
446446
)
447447
);
448448
$out = $this->parseMailerParams($out);

assets/snippets/FormLister/core/controller/Login.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(\DocumentParser $modx, $cfg = array())
2727
if (0 === strpos($requestUri, MODX_BASE_URL)) {
2828
$requestUri = substr($requestUri, strlen(MODX_BASE_URL));
2929
}
30-
$this->requestUri = $this->modx->config['site_url'] . $requestUri;
30+
$this->requestUri = $this->modx->getConfig('site_url') . $requestUri;
3131
$this->context = $this->getCFGDef('context', 'web');
3232
$lang = $this->lexicon->loadLang('login');
3333
if ($lang) {
@@ -93,8 +93,8 @@ public function process()
9393
$loginCookie = $this->getCFGDef('cookieName', 'WebLoginPE');
9494
$this->user->authUser($login, $remember, $loginCookie, true);
9595
$this->setFormStatus(true);
96-
if (isset($this->modx->documentIdentifier) && $this->modx->documentIdentifier == $this->modx->config['unauthorized_page']) {
97-
$uaPage = $this->modx->makeUrl($this->modx->config['unauthorized_page'], "", "", "full");
96+
if (isset($this->modx->documentIdentifier) && $this->modx->documentIdentifier == $this->modx->getConfig('unauthorized_page')) {
97+
$uaPage = $this->modx->makeUrl($this->modx->getConfig('unauthorized_page'), "", "", "full");
9898
$requested = explode('?', $this->requestUri);
9999
if (array_shift($requested) != $uaPage) {
100100
$this->setField('redirectTo', $this->requestUri);

assets/snippets/FormLister/core/controller/Register.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function process()
152152
$uidName => $result,
153153
'hash' => $hash
154154
));
155-
$url = $this->getCFGDef('activateTo', $this->modx->config['site_start']);
155+
$url = $this->getCFGDef('activateTo', $this->modx->getConfig('site_start'));
156156
$this->setField(
157157
'activate.url',
158158
$this->modx->makeUrl($url, '', $query, 'full')

assets/snippets/FormLister/core/controller/Reminder.php

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function process()
136136
$uid = $this->getField($this->userField);
137137
if ($hash = $this->getUserHash($uid)) {
138138
$this->setFields($this->user->toArray());
139-
$url = $this->getCFGDef('resetTo', isset($this->modx->documentIdentifier) && $this->modx->documentIdentifier > 0 ? $this->modx->documentIdentifier : $this->config['site_start']);
139+
$url = $this->getCFGDef('resetTo', isset($this->modx->documentIdentifier) && $this->modx->documentIdentifier > 0 ? $this->modx->documentIdentifier : $this->modx->getConfig('site_start'));
140140
$uidName = $this->getCFGDef('uidName', $this->uidField);
141141
$this->setField('reset.url', $this->modx->makeUrl($url, "",
142142
http_build_query(array($uidName => $this->getField($this->uidField),

assets/snippets/FormLister/lib/Lexicon.php

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function loadLang($name = 'core', $lang = '', $langDir = '')
3434
$langDir = empty($langDir) ? MODX_BASE_PATH . \APIhelpers::getkey($this->cfg, 'langDir',
3535
'lang/') : MODX_BASE_PATH . $langDir;
3636
if (empty($lang)) {
37-
$lang = \APIhelpers::getkey($this->cfg, 'lang', $this->modx->config['manager_language']);
37+
$lang = \APIhelpers::getkey($this->cfg, 'lang', $this->modx->getConfig('manager_language'));
3838
}
3939

4040
if (is_scalar($name) && !empty($name)) {
@@ -70,7 +70,7 @@ private function loadLangFile($name = 'core', $lang = '', $langDir = '')
7070
*/
7171
public function fromArray($lang)
7272
{
73-
$language = \APIhelpers::getkey($this->cfg, 'lang', $this->modx->config['manager_language']);
73+
$language = \APIhelpers::getkey($this->cfg, 'lang', $this->modx->getConfig('manager_language'));
7474
if (is_array($lang) && isset($lang[$language])) {
7575
$this->_lang = array_merge($this->_lang, $lang[$language]);
7676
}

assets/snippets/FormLister/lib/captcha/modxCaptcha/connector.php

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
if (empty ($modx->config)) {
77
$modx->getSettings();
88
}
9-
if(strstr($_SERVER['HTTP_REFERER'],$modx->config['site_url']) === false || !isset($_REQUEST['formid'])) throw new Exception('Wrong captcha request');
9+
if(strstr($_SERVER['HTTP_REFERER'],$modx->getConfig('site_url')) === false || !isset($_REQUEST['formid'])) throw new Exception('Wrong captcha request');
1010
$formid = (string) $_REQUEST['formid'];
1111
include_once ('modxCaptcha.php');
1212
$width = isset($_REQUEST['w']) ? (int) $_REQUEST['w'] : 200;

assets/snippets/FormLister/lib/captcha/modxCaptcha/modxCaptcha.php

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function pickWord()
6464
{
6565
// set default words
6666
$words = "MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote";
67-
$words = $this->modx->config['captcha_words'] ? $this->modx->config['captcha_words'] : $words;
67+
$words = $this->modx->getConfig('captcha_words') ? $this->modx->getConfig('captcha_words') : $words;
6868
$words = str_replace(array(' ', ',,'), array('', ','), $words);
6969
$arr_words = explode(',', $words);
7070

assets/snippets/FormLister/plugin.userHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
}
4747
if (isset($_REQUEST[$logoutKey])) {
4848
$user->logOut($cookieName, true);
49-
$page = $modx->config['site_url'] . (isset($_REQUEST['q']) ? $_REQUEST['q'] : '');
49+
$page = $modx->getConfig('site_url') . (isset($_REQUEST['q']) ? $_REQUEST['q'] : '');
5050
$query = $_GET;
5151
unset($query[$logoutKey], $query['q']);
5252
if ($query) {

install/assets/plugins/userHelper.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* addition to FormLister
66
*
77
* @category plugin
8-
* @version 1.8.0
8+
* @version 1.8.1
99
* @internal @properties &logoutKey=Request key;text;logout &cookieName=Cookie Name;text;WebLoginPE &cookieLifetime=Cookie Lifetime, seconds;text;157680000 &maxFails=Max failed logins;text;3 &blockTime=Block for, seconds;text;3600 &trackWebUserActivity=Track web user activity;list;No,Yes;No
1010
* @internal @events OnWebAuthentication,OnWebPageInit,OnPageNotFound,OnWebLogin
1111
* @internal @modx_category Content

0 commit comments

Comments
 (0)