| (J1.0.15, CB 1.1, SMF 1.1.4 and JSMF 2.0.2.1 may work with other version) Problem : SQL error on line 1194 when users ask for new password because they forget it. Solution : There is a syntax error (no declare and id membber field) in function updatePass in admin.smf.class.php Find (line 1176) : Code: function updatePass($id, $pass) { global $database; $username = $this->getUsername($id); if (empty($username)) { //what to do? //TODO empty username return false; } $smf_id = $this->getSMFid(null, $username); if (empty($smf_id)) { //what to do? //TODO empty uid return false; } $query = "UPDATE {$jsmfConfig->smf_prefix}members " . "SET passwd = '".sha1(strtolower($username).$pass)."' " . "WHERE id= '$smf_id' "; unset($username, $pass, $smf_id); $database->setQuery($query); unset($query); if (!$database->query()) { $this->err = $database->getErrorMsg().' ~~~ FROM::'.__FILE__.' || '.__FUNCTION__.' || '.__LINE__; return false; } return true; } Replace by : Code: function updatePass($id, $pass) { global $database; global $jsmfConfig; $username = $this->getUsername($id); if (empty($username)) { //what to do? //TODO empty username return false; } $smf_id = $this->getSMFid(null, $username); if (empty($smf_id)) { //what to do? //TODO empty uid return false; } $query = "UPDATE {$jsmfConfig->smf_prefix}members " . "SET passwd = '".sha1(strtolower($username).$pass)."' " . "WHERE ID_MEMBER = '$smf_id' "; unset($username, $pass, $smf_id); $database->setQuery($query); unset($query); if (!$database->query()) { $this->err = $database->getErrorMsg().' ~~~ FROM::'.__FILE__.' || '.__FUNCTION__.' || '.__LINE__; return false; } return true; } For those don't like programming I join the class to this post 1-download 2-rename admin.smf.class.txt to admin.smf.class.php 3-FTP it to directory : /www/administrator/components/com_smf/ |
Forum 





Author



Logged






