ImpressCMS Core is an open source project powered by Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

impresscms

Commit 8299

User picture
  • Author: pesianstranger
  • 2009-03-27 00:17 (about 5 years ago)

Fixes #287: Protection works not on the Profile Module.

Files Affected

 
82988299
197
* #484: Fresh install: theme changed after login. (stranger)
197
* #484: Fresh install: theme changed after login. (stranger)
198
* #483: Fresh install: ImpressCMS Logo missing image. (stranger)
198
* #483: Fresh install: ImpressCMS Logo missing image. (stranger)
199
* #477: Improfile and the theme_select function. (stranger)
199
* #477: Improfile and the theme_select function. (stranger)
 
 
200
* #287: Protection works not on the Profile Module. (stranger)
200
 
201
 
201
== Impresscms 1.1.2==
202
== Impresscms 1.1.2==
202
 
203
 
82988299
77
    var $autocomplete = false;
77
    var $autocomplete = false;
78
 
78
 
79
    /**
79
    /**
 
 
80
    * Initial content of the field.
 
 
81
    * @var         string
 
 
82
    * @access     private
 
 
83
    */
 
 
84
    var $_classname;
 
 
85
 
 
 
86
    /**
80
    * Constructor
87
    * Constructor
81
    *
88
    *
82
    * @param    string    $caption    Caption
89
    * @param    string    $caption    Caption
...
 
...
 
86
    * @param    int        $value        Initial value of the field. 
93
    * @param    int        $value        Initial value of the field. 
87
    *                             <b>Warning:</b> this is readable in cleartext in the page's source!
94
    *                             <b>Warning:</b> this is readable in cleartext in the page's source!
88
    */
95
    */
89
    function XoopsFormPassword($caption, $name, $size, $maxlength, $value = '', $autocomplete = false)
96
    function XoopsFormPassword($caption, $name, $size, $maxlength, $value = '', $autocomplete = false, $classname = 'password')
90
    {
97
    {
91
        $this->setCaption($caption);
98
        $this->setCaption($caption);
92
        $this->setName($name);
99
        $this->setName($name);
...
 
...
 
94
        $this->_maxlength = intval($maxlength);
101
        $this->_maxlength = intval($maxlength);
95
        $this->setValue($value);
102
        $this->setValue($value);
96
        $this->autoComplete = !empty($autocomplete);
103
        $this->autoComplete = !empty($autocomplete);
 
 
104
        $this->setClassName($classname);
97
    }
105
    }
98
 
106
 
99
    /**
107
    /**
...
 
...
 
126
    function setValue($value) {$this->_value = $value;}
134
    function setValue($value) {$this->_value = $value;}
127
 
135
 
128
    /**
136
    /**
 
 
137
    * Set the initial value
 
 
138
    * 
 
 
139
    * @param    $value    string
 
 
140
    */
 
 
141
    function setClassName($classname) {$this->_classname = $classname;}
 
 
142
 
 
 
143
    /**
 
 
144
    * Get the "class" attribute
 
 
145
    *
 
 
146
    * @param    bool    $encode To sanitizer the text?
 
 
147
    * @return    string
 
 
148
    */
 
 
149
    function getClassName($encode = false) {return $encode ? htmlspecialchars($this->_classname, ENT_QUOTES) : $this->_classname;}
 
 
150
 
 
 
151
    /**
129
    * Prepare HTML for output
152
    * Prepare HTML for output
130
    *
153
    *
131
    * @return    string    HTML
154
    * @return    string    HTML
...
 
...
 
133
    function render()
156
    function render()
134
    {
157
    {
135
        $ele_name = $this->getName();
158
        $ele_name = $this->getName();
136
        return "<input type='password' name='".$ele_name."' id='".$ele_name."'
size='".$this->getSize()."' maxlength='".$this->getMaxlength()."'
value='".$this->getValue()."'".$this->getExtra()." ".($this->autoComplete ? "" :
"autocomplete='off' ")."/>";
159
        return "<input class='".$this->getClassName()."' type='password' name='".$ele_name."' id='".$ele_name."' size='".$this->getSize()."' maxlength='".$this->getMaxlength()."' value='".$this->getValue()."'".$this->getExtra()." ".($this->autoComplete ? "" : "autocomplete='off' ")."/>";
137
    }
160
    }
138
}
161
}
139
?>
162
?>
82988299
41
 
41
 
42
$config_handler =& xoops_gethandler('config');
42
$config_handler =& xoops_gethandler('config');
43
$xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
43
$xoopsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
44
 
 
 
45
if($op == 'saveuser')
44
if($op == 'saveuser')
46
{
45
{
47
    if(!$GLOBALS['xoopsSecurity']->check())
46
    if(!$GLOBALS['xoopsSecurity']->check())
...
 
...
 
254
        /** Include the header that starts page rendering */
253
        /** Include the header that starts page rendering */
255
      include_once ICMS_ROOT_PATH.'/header.php';
254
      include_once ICMS_ROOT_PATH.'/header.php';
256
        include_once ICMS_ROOT_PATH.'/include/comment_constants.php';
255
        include_once ICMS_ROOT_PATH.'/include/comment_constants.php';
 
 
256
if($xoopsConfigUser['pass_level']){
 
 
257
$xoTheme->addScript(ICMS_URL.'/libraries/jquery/jquery.js', array('type' => 'text/javascript'));
 
 
258
$xoTheme->addScript(ICMS_URL.'/libraries/jquery/password_strength_plugin.js', array('type' => 'text/javascript'));
 
 
259
$xoTheme->addScript('', array('type' => ''), '
 
 
260
                $(document).ready( function() {
 
 
261
                    $.fn.shortPass = "'._CORE_PASSLEVEL1.'";
 
 
262
                    $.fn.badPass = "'._CORE_PASSLEVEL2.'";
 
 
263
                    $.fn.goodPass = "'._CORE_PASSLEVEL3.'";
 
 
264
                    $.fn.strongPass = "'._CORE_PASSLEVEL4.'";
 
 
265
                    $.fn.samePassword = "Username and Password identical.";
 
 
266
                    $.fn.resultStyle = "";
 
 
267
                $(".password_adv").passStrength({
 
 
268
                    shortPass:         "top_shortPass",
 
 
269
                    badPass:        "top_badPass",
 
 
270
                    goodPass:        "top_goodPass",
 
 
271
                    strongPass:        "top_strongPass",
 
 
272
                    baseStyle:        "top_testresult",
 
 
273
                    messageloc:        0
 
 
274
 
 
 
275
                });
 
 
276
            });
 
 
277
');
 
 
278
}
 
 
279
 
257
        echo '<a
href="userinfo.php?uid='.intval($xoopsUser->getVar('uid')).'">'._US_PROFILE.'</a>&nbsp;<span
style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._US_EDITPROFILE.'<br /><br />';
280
        echo '<a
href="userinfo.php?uid='.intval($xoopsUser->getVar('uid')).'">'._US_PROFILE.'</a>&nbsp;<span
style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'._US_EDITPROFILE.'<br /><br />';
258
        $form = new XoopsThemeForm(_US_EDITPROFILE, 'userinfo', 'edituser.php', 'post', true);
281
        $form = new XoopsThemeForm(_US_EDITPROFILE, 'userinfo', 'edituser.php', 'post', true);
259
        $login_name_label = new XoopsFormLabel(_US_LOGINNAME, $xoopsUser->getVar('login_name'));
282
        $login_name_label = new XoopsFormLabel(_US_LOGINNAME, $xoopsUser->getVar('login_name'));
...
 
...
 
363
        $bio_tarea = new XoopsFormTextArea(_US_EXTRAINFO, 'bio', $xoopsUser->getVar('bio', 'E'));
386
        $bio_tarea = new XoopsFormTextArea(_US_EXTRAINFO, 'bio', $xoopsUser->getVar('bio', 'E'));
364
        $cookie_radio_value = empty($_COOKIE[$xoopsConfig['usercookie']]) ? 0 : 1;
387
        $cookie_radio_value = empty($_COOKIE[$xoopsConfig['usercookie']]) ? 0 : 1;
365
        $cookie_radio = new XoopsFormRadioYN(_US_USECOOKIE, 'usecookie', $cookie_radio_value, _YES, _NO);
388
        $cookie_radio = new XoopsFormRadioYN(_US_USECOOKIE, 'usecookie', $cookie_radio_value, _YES, _NO);
366
    $config_handler =& xoops_gethandler('config');
389
        $pwd_text = new XoopsFormPassword('', 'password', 10, 255, "", false, ($xoopsConfigUser['pass_level']?'password_adv':''));
367
    $passConfig =& $config_handler->getConfigsByCat(2);
 
 
368
    if($passConfig['pass_level'] <= 20)
 
 
369
    {
 
 
370
        $pwd_text = new XoopsFormPassword('', 'password', 10, 255);
 
 
371
    }
 
 
372
    else
 
 
373
    {
 
 
374
    $pwd_change_radio = new XoopsFormRadioYN(_US_CHANGE_PASSWORD, 'change_pass', 0, _YES, _NO);
 
 
375
    $pwd_change_radio->setExtra('onchange="initQualityMeter(this.value);"');
 
 
376
        include_once ICMS_ROOT_PATH."/include/passwordquality.php";
 
 
377
    }
 
 
378
        $pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 255);
390
        $pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 255);
379
        $pwd_tray = new XoopsFormElementTray(_US_PASSWORD.'<br />'._US_TYPEPASSTWICE);
391
        $pwd_tray = new XoopsFormElementTray(_US_PASSWORD.'<br />'._US_TYPEPASSTWICE);
380
        $pwd_tray->addElement($pwd_text);
392
        $pwd_tray->addElement($pwd_text);
82988299
257
div.pagination.default span.disabled {
257
div.pagination.default span.disabled {
258
    display: none;
258
    display: none;
259
}
259
}
 
 
260
/*  ADVANCED STYLES */
 
 
261
.top_testresult{
 
 
262
    font-weight: bold;
 
 
263
    font-size:13px;
 
 
264
    font-family: arail,helvetica,san-serif;
 
 
265
    color:#666;
 
 
266
    padding:0;
 
 
267
    margin:0 0 2px 0;
 
 
268
}
 
 
269
.top_testresult span{
 
 
270
    padding:6px ;
 
 
271
    margin:0;
 
 
272
}
 
 
273
.top_shortPass{
 
 
274
    background:#edabab;
 
 
275
    border:1px solid #bc0000;
 
 
276
    display:block;
 
 
277
}
 
 
278
.top_shortPass span{
 
 
279
 
 
 
280
}
 
 
281
.top_badPass{
 
 
282
    background:#edabab;
 
 
283
    border:1px solid #bc0000;
 
 
284
    display:block;
 
 
285
}
 
 
286
.top_badPass span{
 
 
287
 
 
 
288
}
 
 
289
.top_goodPass{
 
 
290
    background:#ede3ab;
 
 
291
    border:1px solid #bc9f00;
 
 
292
    display:block;
 
 
293
}
 
 
294
.top_goodPass span{
 
 
295
 
 
 
296
}
 
 
297
.top_strongPass{
 
 
298
    background:#d3edab;
 
 
299
    border:1px solid #73bc00;
 
 
300
    display:block;
 
 
301
}
 
 
302
.top_strongPass span{
 
 
303
 
 
 
304
}
 
 
305
 
 
 
306
 
 
 
307
/*     RESULT STYLE  */
 
 
308
.testresult{
 
 
309
    font-weight: bold;
 
 
310
    font-size:13px;
 
 
311
    font-family: arial,helvetica,san-serif;
 
 
312
    color:#666;
 
 
313
    padding:0px 0px 12px 10px;
 
 
314
    margin-left:10px;
 
 
315
    display: block;
 
 
316
    height:28px;
 
 
317
    float:left;
 
 
318
}
 
 
319
.testresult span{
 
 
320
    padding:10px 20px 12px 10px;
 
 
321
    margin: 0px 0px 0px 20px;
 
 
322
    display:block;
 
 
323
    float:right;
 
 
324
    white-space: nowrap;
 
 
325
}
 
 
326
.shortPass{
 
 
327
    background:url(images/red.png) no-repeat 0 0;
 
 
328
}
 
 
329
.shortPass span{
 
 
330
    background:url(images/red.png) no-repeat bottom right;
 
 
331
}
 
 
332
.badPass{
 
 
333
    background:url(images/red.png) no-repeat 0 0;
 
 
334
}
 
 
335
.badPass span{
 
 
336
    background:url(images/red.png) no-repeat bottom right;
 
 
337
}
 
 
338
.goodPass{
 
 
339
    background:url(images/yellow.png) no-repeat 0 0;
 
 
340
}
 
 
341
.goodPass span{
 
 
342
    background:url(images/yellow.png) no-repeat bottom right;
 
 
343
}
 
 
344
.strongPass{
 
 
345
    background:url(images/green.png) no-repeat 0 0;
 
 
346
}
 
 
347
.strongPass span{
 
 
348
    background:url(images/green.png) no-repeat bottom right;
 
 
349
}
82988299
407
div.pagination.default span.disabled {
407
div.pagination.default span.disabled {
408
    display: none;
408
    display: none;
409
}
409
}
 
 
410
/*  ADVANCED STYLES */
 
 
411
.top_testresult{
 
 
412
    font-weight: bold;
 
 
413
    font-size:13px;
 
 
414
    font-family: arail,helvetica,san-serif;
 
 
415
    color:#666;
 
 
416
    padding:0;
 
 
417
    margin:0 0 2px 0;
 
 
418
}
 
 
419
.top_testresult span{
 
 
420
    padding:6px ;
 
 
421
    margin:0;
 
 
422
}
 
 
423
.top_shortPass{
 
 
424
    background:#edabab;
 
 
425
    border:1px solid #bc0000;
 
 
426
    display:block;
 
 
427
}
 
 
428
.top_shortPass span{
 
 
429
 
 
 
430
}
 
 
431
.top_badPass{
 
 
432
    background:#edabab;
 
 
433
    border:1px solid #bc0000;
 
 
434
    display:block;
 
 
435
}
 
 
436
.top_badPass span{
 
 
437
 
 
 
438
}
 
 
439
.top_goodPass{
 
 
440
    background:#ede3ab;
 
 
441
    border:1px solid #bc9f00;
 
 
442
    display:block;
 
 
443
}
 
 
444
.top_goodPass span{
 
 
445
 
 
 
446
}
 
 
447
.top_strongPass{
 
 
448
    background:#d3edab;
 
 
449
    border:1px solid #73bc00;
 
 
450
    display:block;
 
 
451
}
 
 
452
.top_strongPass span{
 
 
453
 
 
 
454
}
 
 
455
 
 
 
456
 
 
 
457
/*     RESULT STYLE  */
 
 
458
.testresult{
 
 
459
    font-weight: bold;
 
 
460
    font-size:13px;
 
 
461
    font-family: Tahoma,arial,helvetica,san-serif;
 
 
462
    color:#666;
 
 
463
    padding:0px 0px 12px 10px;
 
 
464
    margin-left:10px;
 
 
465
    display: block;
 
 
466
    height:28px;
 
 
467
    float:right;
 
 
468
}
 
 
469
.testresult span{
 
 
470
    padding:10px 20px 12px 10px;
 
 
471
    margin: 0px 0px 0px 20px;
 
 
472
    display:block;
 
 
473
    float:left;
 
 
474
    white-space: nowrap;
 
 
475
}
 
 
476
.shortPass{
 
 
477
    background:url(images/red.png) no-repeat 0 0;
 
 
478
}
 
 
479
.shortPass span{
 
 
480
    background:url(images/red.png) no-repeat top right;
 
 
481
}
 
 
482
.badPass{
 
 
483
    background:url(images/red.png) no-repeat 0 0;
 
 
484
}
 
 
485
.badPass span{
 
 
486
    background:url(images/red.png) no-repeat top right;
 
 
487
}
 
 
488
.goodPass{
 
 
489
    background:url(images/yellow.png) no-repeat 0 0;
 
 
490
}
 
 
491
.goodPass span{
 
 
492
    background:url(images/yellow.png) no-repeat top right;
 
 
493
}
 
 
494
.strongPass{
 
 
495
    background:url(images/green.png) no-repeat 0 0;
 
 
496
}
 
 
497
.strongPass span{
 
 
498
    background:url(images/green.png) no-repeat top right;
 
 
499
}
82988299
74
$reg_form->addElement($email_tray);
74
$reg_form->addElement($email_tray);
75
//$reg_form->addElement(new XoopsFormPassword(_US_PASSWORD, "pass", 10, 72, $myts->htmlSpecialChars($pass)), true);
75
//$reg_form->addElement(new XoopsFormPassword(_US_PASSWORD, "pass", 10, 72, $myts->htmlSpecialChars($pass)), true);
76
//$reg_form->addElement(new XoopsFormPassword(_US_VERIFYPASS, "vpass", 10, 72, $myts->htmlSpecialChars($vpass)), true);
76
//$reg_form->addElement(new XoopsFormPassword(_US_VERIFYPASS, "vpass", 10, 72, $myts->htmlSpecialChars($vpass)), true);
77
$config_handler =& xoops_gethandler('config');
77
if($xoopsConfigUser['pass_level']){
78
$passConfig =& $config_handler->getConfigsByCat(2);
78
$xoTheme->addScript(ICMS_URL.'/libraries/jquery/jquery.js', array('type' => 'text/javascript'));
79
if ($passConfig['pass_level'] <= 20){
79
$xoTheme->addScript(ICMS_URL.'/libraries/jquery/password_strength_plugin.js', array('type' => 'text/javascript'));
80
    $reg_form->addElement(new XoopsFormPassword(_US_PASSWORD, "pass", 10, 255, $myts->htmlSpecialChars($pass)), true);
80
$xoTheme->addScript('', array('type' => ''), '
81
}else{
81
                $(document).ready( function() {
82
    include_once XOOPS_ROOT_PATH."/include/passwordquality.php";
82
                    $.fn.shortPass = "'._CORE_PASSLEVEL1.'";
 
 
83
                    $.fn.badPass = "'._CORE_PASSLEVEL2.'";
 
 
84
                    $.fn.goodPass = "'._CORE_PASSLEVEL3.'";
 
 
85
                    $.fn.strongPass = "'._CORE_PASSLEVEL4.'";
 
 
86
                    $.fn.samePassword = "Username and Password identical.";
 
 
87
                    $.fn.resultStyle = "";
 
 
88
                $(".password_adv").passStrength({
 
 
89
                    shortPass:         "top_shortPass",
 
 
90
                    badPass:        "top_badPass",
 
 
91
                    goodPass:        "top_goodPass",
 
 
92
                    strongPass:        "top_strongPass",
 
 
93
                    baseStyle:        "top_testresult",
 
 
94
                    messageloc:        0
 
 
95
 
 
 
96
                });
 
 
97
            });
 
 
98
');
83
}
99
}
 
 
100
$reg_form->addElement(new XoopsFormPassword(_US_PASSWORD, "pass", 10, 255, $myts->htmlSpecialChars($pass), false,
($xoopsConfigUser['pass_level']?'password_adv':'')), true);
84
$reg_form->addElement(new XoopsFormPassword(_US_VERIFYPASS, "vpass", 10, 255, $myts->htmlSpecialChars($vpass)), true);
101
$reg_form->addElement(new XoopsFormPassword(_US_VERIFYPASS, "vpass", 10, 255, $myts->htmlSpecialChars($vpass)), true);
85
$reg_form->addElement(new XoopsFormText(_US_WEBSITE, "url", 25, 255, $myts->htmlSpecialChars($url)));
102
$reg_form->addElement(new XoopsFormText(_US_WEBSITE, "url", 25, 255, $myts->htmlSpecialChars($url)));
86
$tzselected = ($timezone_offset != "") ? $timezone_offset : $xoopsConfig['default_TZ'];
103
$tzselected = ($timezone_offset != "") ? $timezone_offset : $xoopsConfig['default_TZ'];
82988299
51
define('_CORE_DB_NOTRACE', 'notrace:mysql extension not loaded');
51
define('_CORE_DB_NOTRACE', 'notrace:mysql extension not loaded');
52
define('_CORE_DB_NOTALLOWEDINGET', 'Database updates are not allowed during processing of a GET request');
52
define('_CORE_DB_NOTALLOWEDINGET', 'Database updates are not allowed during processing of a GET request');
53
define('_CORE_DB_NOTRACEDB', 'notrace:Unable to connect to database');
53
define('_CORE_DB_NOTRACEDB', 'notrace:Unable to connect to database');
54
define('_CORE_DB_INVALIDEMAIL', "Invalid Email");
54
define('_CORE_DB_INVALIDEMAIL', 'Invalid Email');
 
 
55
define('_CORE_PASSLEVEL1','Too short');
 
 
56
define('_CORE_PASSLEVEL2','Weak');
 
 
57
define('_CORE_PASSLEVEL3','Good');
 
 
58
define('_CORE_PASSLEVEL4','Strong');
55
?>
59
?>
Show contents
82988299
20
}
20
}
21
$xoopsOption['template_main'] = 'profile_changepass.html';
21
$xoopsOption['template_main'] = 'profile_changepass.html';
22
include ICMS_ROOT_PATH.'/header.php';
22
include ICMS_ROOT_PATH.'/header.php';
 
 
23
$config_handler =& xoops_gethandler('config');
 
 
24
$icmsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
 
 
25
if($icmsConfigUser['pass_level']){
 
 
26
$xoTheme->addScript(ICMS_URL.'/libraries/jquery/jquery.js', array('type' => 'text/javascript'));
 
 
27
$xoTheme->addScript(ICMS_URL.'/libraries/jquery/password_strength_plugin.js', array('type' => 'text/javascript'));
 
 
28
$xoTheme->addScript('', array('type' => ''), '
 
 
29
                $(document).ready( function() {
 
 
30
                    $.fn.shortPass = "'._CORE_PASSLEVEL1.'";
 
 
31
                    $.fn.badPass = "'._CORE_PASSLEVEL2.'";
 
 
32
                    $.fn.goodPass = "'._CORE_PASSLEVEL3.'";
 
 
33
                    $.fn.strongPass = "'._CORE_PASSLEVEL4.'";
 
 
34
                    $.fn.samePassword = "Username and Password identical.";
 
 
35
                    $.fn.resultStyle = "";
 
 
36
                $(".password_adv").passStrength({
 
 
37
                    shortPass:         "top_shortPass",
 
 
38
                    badPass:        "top_badPass",
 
 
39
                    goodPass:        "top_goodPass",
 
 
40
                    strongPass:        "top_strongPass",
 
 
41
                    baseStyle:        "top_testresult",
 
 
42
                    messageloc:        0
23
 
43
 
 
 
44
                });
 
 
45
            });
 
 
46
');
 
 
47
}
24
if (!isset($_POST['submit'])) {
48
if (!isset($_POST['submit'])) {
25
    //show change password form
49
    //show change password form
26
    include_once ICMS_ROOT_PATH.'/class/xoopsformloader.php';
50
    include_once ICMS_ROOT_PATH.'/class/xoopsformloader.php';
27
    $form = new XoopsThemeForm(_PROFILE_MA_CHANGEPASSWORD, 'form', $_SERVER['REQUEST_URI'], 'post', true);
51
    $form = new XoopsThemeForm(_PROFILE_MA_CHANGEPASSWORD, 'form', $_SERVER['REQUEST_URI'], 'post', true);
28
    $form->addElement(new XoopsFormPassword(_PROFILE_MA_OLDPASSWORD, 'oldpass', 10, 50), true);
52
    $form->addElement(new XoopsFormPassword(_PROFILE_MA_OLDPASSWORD, 'oldpass', 10, 50), true);
29
    $config_handler =& xoops_gethandler('config');
53
    $pwd_text = new XoopsFormPassword('', 'password', 10, 255, '', false, ($icmsConfigUser['pass_level']?'password_adv':''));
30
    $passConfig =& $config_handler->getConfigsByCat(2);
54
    $pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 255);
31
    if($passConfig['pass_level'] <= 20)
55
    $pwd_tray = new XoopsFormElementTray(_PROFILE_MA_NEWPASSWORD.'<br />'._PROFILE_MA_VERIFYPASS);
32
    {
56
    $pwd_tray->addElement($pwd_text);
33
        $pwd_text = new XoopsFormPassword('', 'password', 10, 255);
57
    $pwd_tray->addElement($pwd_text2);
34
    }
58
    $form->addElement($pwd_tray);
35
    else
 
 
36
    {
 
 
37
    $pwd_change_radio = new XoopsFormRadioYN(_US_CHANGE_PASSWORD, 'change_pass', 1, _YES, _NO);
 
 
38
    $pwd_change_radio->setExtra('onchange="initQualityMeter(this.value);"');
 
 
39
        include_once ICMS_ROOT_PATH."/include/passwordquality.php";
 
 
40
    }
 
 
41
        $pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 255);
 
 
42
        $pwd_tray = new XoopsFormElementTray(_PROFILE_MA_NEWPASSWORD.'<br />'._PROFILE_MA_VERIFYPASS);
 
 
43
        $pwd_tray->addElement($pwd_text);
 
 
44
        $pwd_tray->addElement($pwd_text2);
 
 
45
        $form->addElement($pwd_change_radio);
 
 
46
        $form->addElement($pwd_tray);
 
 
47
    $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
59
    $form->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
48
    $form->assign($xoopsTpl);
60
    $form->assign($xoopsTpl);
49
 
61
 
...
 
...
 
59
    }
71
    }
60
    else {
72
    else {
61
        //update password
73
        //update password
62
        $config_handler =& xoops_gethandler('config');
 
 
63
        $icmsConfigUser =& $config_handler->getConfigsByCat(XOOPS_CONF_USER);
 
 
64
        $salt = icms_createSalt();
74
        $salt = icms_createSalt();
65
        $pass = icms_encryptPass($_POST['newpass'], $salt);
75
        $pass = icms_encryptPass($_POST['newpass'], $salt);
66
        $xoopsUser->setVar('pass', $pass);
76
        $xoopsUser->setVar('pass', $pass);
82988299
285
        $elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_EMAIL, "email", $uname_size, 60,
$user->getVar('email', 'e')), 'required' => true);
285
        $elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_EMAIL, "email", $uname_size, 60,
$user->getVar('email', 'e')), 'required' => true);
286
        $weights[0][] = 0;
286
        $weights[0][] = 0;
287
 
287
 
288
        $elements[0][] = array('element' => new XoopsFormPassword(_PROFILE_MA_PASSWORD, "pass", 10, 32, ""),
'required' => true);
288
        $elements[0][] = array('element' => new XoopsFormPassword(_PROFILE_MA_PASSWORD, "pass", 10, 32, "", false, ($icmsConfigUser['pass_level']?'password_adv':'')), 'required' => true);
289
        $weights[0][] = 0;
289
        $weights[0][] = 0;
 
 
290
 
290
        $elements[0][] = array('element' => new XoopsFormPassword(_PROFILE_MA_VERIFYPASS, "vpass", 10, 32, ""),
'required' => true);
291
        $elements[0][] = array('element' => new XoopsFormPassword(_PROFILE_MA_VERIFYPASS, "vpass", 10, 32, ""),
'required' => true);
291
        $weights[0][] = 0;
292
        $weights[0][] = 0;
292
    }
293
    }
...
 
...
 
447
 
448
 
448
    if ($xoopsUser->isAdmin() && $user->getVar('uid') != $xoopsUser->getVar('uid')) {
449
    if ($xoopsUser->isAdmin() && $user->getVar('uid') != $xoopsUser->getVar('uid')) {
449
        //If the user is an admin and is editing someone else
450
        //If the user is an admin and is editing someone else
450
        $pwd_text = new XoopsFormPassword('', 'password', 10, 32);
451
        $pwd_text = new XoopsFormPassword('', 'password', 10, 32, "", false, ($icmsConfigUser['pass_level']?'password_adv':''));
451
        $pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 32);
452
        $pwd_text2 = new XoopsFormPassword('', 'vpass', 10, 32);
452
        $pwd_tray = new XoopsFormElementTray(_PROFILE_MA_PASSWORD.'<br />'._PROFILE_MA_TYPEPASSTWICE);
453
        $pwd_tray = new XoopsFormElementTray(_PROFILE_MA_PASSWORD.'<br />'._PROFILE_MA_TYPEPASSTWICE);
453
        $pwd_tray->addElement($pwd_text);
454
        $pwd_tray->addElement($pwd_text);
82988299
29
}
29
}
30
$xoopsOption['template_main'] = 'profile_register.html';
30
$xoopsOption['template_main'] = 'profile_register.html';
31
include ICMS_ROOT_PATH.'/header.php';
31
include ICMS_ROOT_PATH.'/header.php';
 
 
32
if($icmsConfigUser['pass_level']){
 
 
33
$xoTheme->addScript(ICMS_URL.'/libraries/jquery/jquery.js', array('type' => 'text/javascript'));
 
 
34
$xoTheme->addScript(ICMS_URL.'/libraries/jquery/password_strength_plugin.js', array('type' => 'text/javascript'));
 
 
35
$xoTheme->addScript('', array('type' => ''), '
 
 
36
                $(document).ready( function() {
 
 
37
                    $.fn.shortPass = "'._CORE_PASSLEVEL1.'";
 
 
38
                    $.fn.badPass = "'._CORE_PASSLEVEL2.'";
 
 
39
                    $.fn.goodPass = "'._CORE_PASSLEVEL3.'";
 
 
40
                    $.fn.strongPass = "'._CORE_PASSLEVEL4.'";
 
 
41
                    $.fn.samePassword = "Username and Password identical.";
 
 
42
                    $.fn.resultStyle = "";
 
 
43
                $(".password_adv").passStrength({
 
 
44
                    shortPass:         "top_shortPass",
 
 
45
                    badPass:        "top_badPass",
 
 
46
                    goodPass:        "top_goodPass",
 
 
47
                    strongPass:        "top_strongPass",
 
 
48
                    baseStyle:        "top_testresult",
 
 
49
                    messageloc:        0
32
 
50
 
 
 
51
                });
 
 
52
            });
 
 
53
');
 
 
54
}
 
 
55
 
33
$member_handler =& xoops_gethandler('member');
56
$member_handler =& xoops_gethandler('member');
34
 
57
 
35
$template_dir = ICMS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/mail_template';
58
$template_dir = ICMS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/mail_template';
82988299
59
switch ( $op ) {
59
switch ( $op ) {
60
case 'newuser':
60
case 'newuser':
61
    include 'header.php';
61
    include 'header.php';
 
 
62
                                     $xoTheme->addScript('', array('type' => ''), '
 
 
63
                $(".password").passStrength({
 
 
64
                    shortPass:         "top_shortPass",
 
 
65
                    badPass:        "top_badPass",
 
 
66
                    goodPass:        "top_goodPass",
 
 
67
                    strongPass:        "top_strongPass",
 
 
68
                    baseStyle:        "top_testresult",
 
 
69
                    messageloc:        0
 
 
70
                });
 
 
71
            });
 
 
72
');
62
    $stop = '';
73
    $stop = '';
63
    if (!$GLOBALS['xoopsSecurity']->check()) {
74
    if (!$GLOBALS['xoopsSecurity']->check()) {
64
        $stop .= implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())."<br />";
75
        $stop .= implode('<br />', $GLOBALS['xoopsSecurity']->getErrors())."<br />";