Hello people, I'm a happy user of Hotaru for some time, started with release 1.4.2 and with that release I got the problem that I could not login anymore. If I click on login I get "This post is pending approval by a moderator" I upgraded to release 1.5.2 with the hope that the problem would be fixed, but saidly it didn't help... So can anybody help me so I can login again... ?????
Hmmm... that's an odd error I haven't heard of before. The most obvious question is - have you made any changes to the code? Also, I suggest checking your error log. If you can't login to check it, you can use your FTP client (or even the hosting provider's Web-based one) to go to the /cache/debug_logs directory and open the error_log.php file. That may indicate what's causing the problem.
I never changed anything to the code, and it worked pretty good for a long time... the login problem started not so long ago.... You can check it out at http://postit.in.th The error_log file for yesterday is Code: [24-May-2014 00:06:48 America/Denver] PHP Notice: unserialize(): Error at offset 94 of 95 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 00:35:26 America/Denver] PHP Notice: unserialize(): Error at offset 106 of 107 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 02:58:02 America/Denver] PHP Notice: unserialize(): Error at offset 106 of 107 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 07:40:35 America/Denver] PHP Notice: unserialize(): Error at offset 148 of 149 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 08:45:26 America/Denver] PHP Parse error: syntax error, unexpected end of file in /hosting/domain/public_html/postitin/cache/lang_cache/language.php on line 2 [24-May-2014 09:10:59 America/Denver] PHP Notice: unserialize(): Error at offset 138 of 139 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 12:47:42 America/Denver] PHP Notice: Undefined index: saved_posts in /hosting/domain/public_html/postitin/content/plugins/save_post/templates/save_post_page.php on line 12 [24-May-2014 12:51:40 America/Denver] PHP Notice: unserialize(): Error at offset 106 of 107 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 12:58:37 America/Denver] PHP Notice: unserialize(): Error at offset 17 of 189 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 13:04:19 America/Denver] PHP Notice: unserialize(): Error at offset 112 of 113 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 13:04:26 America/Denver] PHP Notice: unserialize(): Error at offset 248 of 250 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 15:27:10 America/Denver] PHP Notice: unserialize(): Error at offset 106 of 107 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 15:37:39 America/Denver] PHP Parse error: syntax error, unexpected end of file in /hosting/domain/public_html/postitin/cache/lang_cache/language.php on line 2 [24-May-2014 16:03:48 America/Denver] PHP Notice: unserialize(): Error at offset 17 of 82 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 16:11:20 America/Denver] PHP Notice: Undefined index: saved_posts in /hosting/domain/public_html/postitin/content/plugins/save_post/templates/save_post_page.php on line 12 [24-May-2014 17:17:01 America/Denver] PHP Notice: unserialize(): Error at offset 106 of 107 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 17:25:14 America/Denver] PHP Notice: unserialize(): Error at offset 153 of 154 bytes in /hosting/domain/public_html/postitin/libs/UserBase.php on line 452 [24-May-2014 17:30:11 America/Denver] PHP Warning: unlink(/hosting/domain/public_html/postitin/cache/db_cache/7a7d52669213740622cce5cca86f4f93.updating): No such file or directory in /hosting/domain/public_html/postitin/libs/extensions/ezSQL/ez_sql_core.php on line 305{/code]
This is an odd one. You're getting many errors from the usermeta table (line 452 of /libs/UserBase.php). I doubt this will make a difference, but you should try to clear your cache. (If you can't login to clear it, you can delete the individual files in the /cache subdirectories using your FTP client.) You also are getting an unexpected end of file error in your language cache. I get this all the time and, for the life of me, I haven't been able to figure out why. If clearing your cache doesn't solve the problem, the next thing I'd suggest is trying to analyze the data in your usermeta table for any anomalies. You can use a tool like http://blog.tanist.co.uk/files/unserialize/index.php to look at the usermeta_value data. It might be corrupted somehow. If you're not able to find any problems with the data, you might want to back up the data in the usermeta table, truncate the usermeta table (which will delete all the data in it), and then see if you can log in. If you still can't, you can then reload the table with your backup data. Why not try some of those suggestions and report back here?
I cleared the all the cache sub-folders and it didn't fix the problem... Will try to play with the SQL database tomorrow....
Now that I think about it, you can also try to login via http://your_site/admin_index.php?page=admin_login.
Just looking at a few of these errors I would like to try and find the answer at least for this part. In the new code line 452 is actually blank, so I guess your code is a bit different. Could you paste the code from the /libs/UserBase.php file around lines 450. Maybe 20-30 lines of code either side would be good. I think it may be to do with the Code: public function getProfileSettingsData method but not sure yet The 1.4.2 version had this around the line 450 mark Code: if ($result) { $result = unserialize($result); if ($type == 'user_settings') { $defaults = $this->getDefaultSettings($h); if ($defaults) { $result = array_merge($defaults, $result); } } } elseif ($type == 'user_settings') { return $this->getDefaultSettings($h); } else { return false; } unserialize($result) looks like it would be the problem if the data is not in the right format I think we had this problem somewhere else and the answer was to encode the data on the way in and decode it on the way out (not encryption, just encoding) something like Code: base64_encode(serialize($User));// encode the serialized object unserialize(base64_decode($User));// decode it before unserializing
For me the code from line 440 until line 475 is Code: // get user settings: $this->settings = $this->getProfileSettingsData($h, 'user_settings', $this->id); $this->id = $user_info->user_id; $this->name = $user_info->user_username; $this->password = $user_info->user_password; $this->role = $user_info->user_role; $this->idAdmin = $this->role == 'admin' ? true : false; $this->adminAccess = $this->getPermission('can_access_admin') == 'yes' ? true : false; $this->email = $user_info->user_email; $this->emailValid = $user_info->user_email_valid; $this->ip = $user_info->user_ip; return $user_info; } /**
Sorry that didn't work. I agree with Alan that the problem appears to be caused with unserialize. As I wouldn't want you to post any live user data publicly, would you please private message me with either a few examples (rows) of the values in the usermeta_value field of your usermeta table or the full SQL of just that table (you can backup just the table as an SQL dump - I don't need or want your whole database). I can look at the data and see what might be corrupted.
Hmmm... this doesn't look like the proper code given the error. Are you sure this is from the /libs/UserBase.php file starting at line 440?? If it is, then there's a major problem with that file. If you're using hotaru base 1.5.2, lines 440 - 475 should look like this: Code: } else { $h->smartCache('on', 'usermeta', 60, $sql); // start using database cache $result = $h->db->get_var($sql); $h->vars[$sql] = $result; // cache result in memory (saves for just this page load) $h->smartCache('off'); // stop using database cache } // if we're only testing to see if the settings exist, return here: if($check_exists_only && $result) { return true; } if($check_exists_only && !$result) { return false; } if ($result) { $result = unserialize($result); if ($type == 'user_settings') { $defaults = $this->getDefaultSettings($h); if ($defaults) { $result = array_merge($defaults, $result); } } } elseif ($type == 'user_settings') { return $this->getDefaultSettings($h); } else { return false; } return $result; } /** * Save a user's profile or settings data * * @return array|false */ public function saveProfileSettingsData($h, $data = array(), $type = 'user_profile', $userid = 0) { The code you posted looks like it starts at line 221.
As I mentioned, I'm happy to look at the data in the usermeta table (which I believe is what's causing the error). Did you truncate the table (after making a backup so you can reload) and then try to login? If you don't want to try that, the only other avenue I'd suggest is modifying the code to temporarily ignore the user preferences from the usermeta table. To do that, you'd add return false; to line 450 of /libs/UserBase.php (right before if ($result) {). It would look like this: Code: } else { $h->smartCache('on', 'usermeta', 60, $sql); // start using database cache $result = $h->db->get_var($sql); $h->vars[$sql] = $result; // cache result in memory (saves for just this page load) $h->smartCache('off'); // stop using database cache } // if we're only testing to see if the settings exist, return here: if($check_exists_only && $result) { return true; } if($check_exists_only && !$result) { return false; } return false; if ($result) { $result = unserialize($result); if ($type == 'user_settings') { $defaults = $this->getDefaultSettings($h); if ($defaults) { $result = array_merge($defaults, $result); } } } elseif ($type == 'user_settings') { return $this->getDefaultSettings($h); } else { return false; } return $result; } /** * Save a user's profile or settings data * * @return array|false */ public function saveProfileSettingsData($h, $data = array(), $type = 'user_profile', $userid = 0) { This should prevent the code from reaching the serialize problem and, at least, allow you to login. However, none of the information in the user preferences table would then be available (e.g., bio, link action).
Actually, I have another idea as to the cause of the problem. Hotaru can be a bit finicky when it comes to plugin order. (I've modified my code to always put the most important plugins in a certain order every time I add or delete a plugin to make sure they always execute in a certain order.) I'm wondering if the plugin order of your build is messed up. To try this, you're going to have to modify the data in the database directly, so I'd suggest making a backup of the entire database first before doing this. It might be either the Submit plugin or the Post Manager plugin that is executing before the User Signin plugin. So the first thing to try is manually going into the hotaru_plugins table and changing the plugin_enabled field from 1 to 0 for both the Submit and Post Manager plugins. This will turn off those two plugins. You can either go into the individual rows to do that or you can simply execute the following SQL (substituting your database name): Code: UPDATE `YOUR DATABASE NAME`.`hotaru_plugins` SET `plugin_enabled` = '0' WHERE `plugin_folder` = 'post_manager' OR `plugin_folder` = 'submit'; If that doesn't work, the second thing to try would be to manually put the User Signin plugin first in priority. I'd suggest making it second. To do that, you're going to have to look at the table and find out which plugin is currently set to 2 (in the field plugin_order). Then check what plugin order User Signin is currently set to. Then, you're going to effectively swap those (so User Signin becomes #2 in order and the other plugin becomes whatever User Signin was). Then try to login. Based on the build, it appears you should have the knowledge to do this but, if you don't, you can PM me your database login information and I can try to do it for you.