alert('"._NOT_AUTH."'); window.history.go(-1); \n"; exit(); } } function sendNewPass() { global $conn,$lm_title,$Itemid,$checkusername,$confirmEmail,$limbocore; $_sitename = $lm_title; $rs=$conn->Execute( "SELECT id FROM #__users" . "\nWHERE username='".$checkusername."' AND email='".$confirmEmail."'"); if($rs && $rs->RecordCount()>0 && $rsa=$rs->GetArray()) { $user_id=$rsa[0]['id']; }else { echo "\n"; exit(); } $adminName = $limbocore->getVar("lm_username"); $adminEmail = $limbocore->getVar("lm_email"); $newpass = makePass(); $message = _NEWPASS_MSG; eval ("\$message = \"$message\";"); $subject = _NEWPASS_SUB; eval ("\$subject = \"$subject\";"); send_email($confirmEmail,$subject,$message); $enewpass = md5( $newpass ); $conn->Execute("UPDATE #__users SET password='$enewpass' WHERE id='$user_id'"); if( ($adminName==$checkusername) && ($confirmEmail == $adminEmail) ) { $limbocore->setVar("lm_password",$newpass); $limbocore->setConfig(); } $limbocore->redir( "index.php?mosmsg="._NEWPASS_SENT ); } function makePass(){ $makepass=""; $salt = "abchefghjkmnpqrstuvwxyz0123456789"; srand((double)microtime()*1000000); $i = 0; while ($i <= 7) { $num = rand() % 33; $tmp = substr($salt, $num, 1); $makepass = $makepass . $tmp; $i++; } return ($makepass); } function saveRegistration() { global $conn,$lm_userregistration,$lm_useractivation,$lm_emailpass,$my,$limbocore; global $lm_website,$lm_title,$reg_name,$reg_username,$reg_email,$reg_password; if (!$lm_userregistration) {mosNotAuth(); return;} if ($lm_useractivation) { $reg_password = makePass(); } $my->register(); $mosConfig_live_site=$lm_website; $subject = sprintf (_SEND_SUB, $reg_name, $lm_title); if ($lm_emailpass=="0"){ $message = _USEND_MSG_NOPASS; eval ("\$message = \"$message\";"); } else { if($lm_useractivation) { $message = sprintf (_USEND_MSG_ACTIVATE,$reg_name,$lm_website,$lm_website."index.php?option=login",$reg_username,$reg_username,$reg_password); }else { $message = sprintf (_USEND_MSG, $reg_name,$lm_website,$lm_website."index.php?option=login"); } eval ("\$message = \"$message\";"); } send_email($reg_email,$subject,$message); if ($lm_emailpass == "0"){ echo _REG_COMPLETE_NOPASS; } else { if($lm_useractivation)echo _SENDING_PASSWORD; else echo _REG_COMPLETE; } } ?>