public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Search Repo:
Fix a few inconsistencies in the CmsLogin class

Signed-off-by: Ted Kulp <ted@cmsmadesimple.org>


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@4438 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
Tue Apr 15 03:12:59 -0700 2008
commit  fb6d3e205fb51b37f67afd598e7f8dda4fb27c65
tree    caba7eee9171748791d1074b967c02c7ed9bbc9c
parent  2e86d6ea027f078e5716872246c98381d2c90762
...
62
63
64
65
 
66
67
68
69
70
71
72
 
73
74
75
76
77
78
79
 
80
81
82
83
84
85
 
86
87
88
89
90
 
91
92
93
...
98
99
100
101
 
102
103
104
...
109
110
111
112
 
113
114
115
116
117
...
149
150
151
152
 
153
154
155
156
157
 
158
159
160
161
162
 
163
164
165
...
195
196
197
198
 
199
200
201
202
...
231
232
233
234
 
235
236
237
238
239
 
240
241
242
...
253
254
255
256
 
257
258
259
...
282
283
284
285
 
286
287
288
...
370
371
372
373
 
374
375
376
...
381
382
383
384
 
385
386
387
...
62
63
64
 
65
66
67
68
69
70
71
 
72
73
74
75
76
77
78
 
79
80
81
82
83
84
 
85
86
87
88
89
 
90
91
92
93
...
98
99
100
 
101
102
103
104
...
109
110
111
 
112
113
114
115
116
117
...
149
150
151
 
152
153
154
155
156
 
157
158
159
160
161
 
162
163
164
165
...
195
196
197
 
198
199
200
201
202
...
231
232
233
 
234
235
236
237
238
 
239
240
241
242
...
253
254
255
 
256
257
258
259
...
282
283
284
 
285
286
287
288
...
370
371
372
 
373
374
375
376
...
381
382
383
 
384
385
386
387
0
@@ -62,32 +62,32 @@
0
     //Handle a current login if one is in queue in the SESSION
0
     if (isset($_SESSION['login_user_id']))
0
     {
0
- debug_buffer("Found login_user_id. Going to generate the user object.");
0
+ //debug_buffer("Found login_user_id. Going to generate the user object.");
0
       self::generate_user_object($_SESSION['login_user_id']);
0
       unset($_SESSION['login_user_id']);
0
     }
0
 
0
     if (isset($_SESSION['login_cms_language']))
0
     {
0
- debug_buffer('Setting language to: ' . $_SESSION['login_cms_language']);
0
+ //debug_buffer('Setting language to: ' . $_SESSION['login_cms_language']);
0
       setcookie('cms_language', $_SESSION['login_cms_language'], 0, self::get_cookie_path());
0
       unset($_SESSION['login_cms_language']);
0
     }
0
 
0
     if (!isset($_SESSION["cmsms_user_id"]))
0
     {
0
- debug_buffer('No session found. Now check for cookies');
0
+ //debug_buffer('No session found. Now check for cookies');
0
       if (isset($_COOKIE["cmsms_user_id"]) && isset($_COOKIE["cmsms_passhash"]))
0
       {
0
         debug_buffer('Cookies found, do a passhash check');
0
         if (check_passhash(isset($_COOKIE["cmsms_user_id"]), isset($_COOKIE["cmsms_passhash"])))
0
         {
0
- debug_buffer('passhash check succeeded... creating session object');
0
+ //debug_buffer('passhash check succeeded... creating session object');
0
           self::generate_user_object($_COOKIE["cmsms_user_id"]);
0
         }
0
         else
0
         {
0
- debug_buffer('passhash check failed... redirect to login');
0
+ //debug_buffer('passhash check failed... redirect to login');
0
           $_SESSION["redirect_url"] = $_SERVER["REQUEST_URI"];
0
           if (false == $no_redirect)
0
           {
0
@@ -98,7 +98,7 @@
0
       }
0
       else
0
       {
0
- debug_buffer('No cookies found. Redirect to login.');
0
+ //debug_buffer('No cookies found. Redirect to login.');
0
         $_SESSION["redirect_url"] = $_SERVER["REQUEST_URI"];
0
         if (false == $no_redirect)
0
         {
0
@@ -109,7 +109,7 @@
0
     }
0
     else
0
     {
0
- debug_buffer('Session found. Moving on...');
0
+ //debug_buffer('Session found. Moving on...');
0
       return true;
0
     }
0
   }
0
0
0
@@ -149,17 +149,17 @@
0
             }
0
             else
0
             {
0
- $error .= lang('authenticationfailed 3');
0
+ $error .= _('Invalid OpenID');
0
             }
0
           }
0
           else
0
           {
0
- $error .= lang('authenticationfailed 2');
0
+ $error .= _('Invalid OpenID');
0
           }
0
         }
0
         else
0
         {
0
- $error .= lang('authenticationfailed 1');
0
+ $error .= _('Invalid OpenID');
0
         }
0
       }
0
     }
0
@@ -195,7 +195,7 @@
0
         }
0
         else
0
         {
0
- $error .= lang('usernameincorrect');
0
+ $error .= _('Username or password incorrect');
0
         }
0
       }
0
       else if ($username != '' && $password != '' && isset($_POST['loginsubmit']))
0
0
@@ -231,12 +231,12 @@
0
         }
0
         else
0
         {
0
- $error .= lang('usernameincorrect');
0
+ $error .= _('Username or password incorrect');
0
         }
0
       }
0
       else
0
       {
0
- $error .= lang('usernameincorrect');
0
+ $error .= _('Username or password incorrect');
0
       }
0
     }
0
   }
0
@@ -253,7 +253,7 @@
0
    */
0
   static public function login($username, $password)
0
   {
0
- $oneuser = cmsms()->cms_user->find_by_username($username);
0
+ $oneuser = cms_orm('CmsUser')->find_by_username($username);
0
 
0
     if ($oneuser != null && $oneuser->password == md5($password))
0
     {
0
@@ -282,7 +282,7 @@
0
    */
0
   static public function login_by_id($user_id)
0
   {
0
- $oneuser = cmsms()->cms_user->find_by_id($user_id);
0
+ $oneuser = cms_orm('CmsUser')->find_by_id($user_id);
0
 
0
     if ($oneuser != null)
0
     {
0
@@ -370,7 +370,7 @@
0
   
0
   static public function check_passhash($userid, $checksum)
0
   {
0
- $oneuser = cmsms()->cms_user->find_by_id($userid);
0
+ $oneuser = cms_orm('CmsUser')->find_by_id($userid);
0
     if ($oneuser && $checksum == md5(md5(ROOT_DIR . '--' . $oneuser->password)))
0
     {
0
       return true;
0
@@ -381,7 +381,7 @@
0
   
0
   static public function generate_user_object($userid)
0
   {
0
- $oneuser = cmsms()->cms_user->find_by_id($userid);
0
+ $oneuser = cms_orm('CmsUser')->find_by_id($userid);
0
     if ($oneuser)
0
     {
0
       $_SESSION['cmsms_user'] = $oneuser;

Comments

    No one has commented yet.