Changeset 142 for minimanager/register.php
- Timestamp:
- Nov 23, 2007, 11:29:33 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
minimanager/register.php
r131 r142 13 13 // DO REGISTER 14 14 //##################################################################################################### 15 function doregister() 16 { 15 function doregister(){ 17 16 global $lang_global, $realm_db, $disable_acc_creation, $limit_acc_per_ip, $valid_ip_mask, 18 $send_mail_on_creation, $create_acc_locked, $from_mail, $mailer_type, $smtp_cfg, $title , $MaximumAccountCount;17 $send_mail_on_creation, $create_acc_locked, $from_mail, $mailer_type, $smtp_cfg, $title; 19 18 20 19 if ( empty($_POST['pass']) || empty($_POST['email']) || empty($_POST['username']) ) { … … 22 21 } 23 22 24 $sql = new SQL;25 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);26 27 $result = $sql->query("SELECT COUNT(*) FROM account");28 $AccountCount = $sql->result($result, 0, 'COUNT(*)');29 if($AccountCount >= $MaximumAccountCount) redirect("register.php?err=4");30 31 23 if ($disable_acc_creation) redirect("register.php?err=4"); 32 24 … … 58 50 } 59 51 52 $sql = new SQL; 53 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']); 60 54 61 55 $user_name = $sql->quote_smart(trim($_POST['username'])); … … 162 156 alert('{$lang_register['diff_pass_entered']}'); 163 157 return; 158 } else if (document.form.pass1.value.length > 225){ 159 alert('{$lang_register['pass_too_long']}'); 160 return; 164 161 } else { 165 162 document.form.pass.value = hex_sha1(document.form.username.value.toUpperCase()+':'+document.form.pass1.value.toUpperCase()); … … 172 169 answerbox.btn_icon=''; 173 170 </script> 174 <fieldset style=\"width: 550px;\">171 <fieldset class=\"half_frame\"> 175 172 <legend>{$lang_register['create_acc']}</legend> 176 173 <form method=\"post\" action=\"register.php?action=doregister\" name=\"form\"> … … 215 212 216 213 $terms = "<textarea rows=\'18\' cols=\'80\' readonly=\'readonly\'>"; 217 $terms_text = '';218 214 $fp = fopen("mail_templates/terms.tpl", 'r') or die (error("Couldn't Open terms.tpl File!")); 219 while (!feof($fp)) $terms _text.= fgets($fp, 1024);215 while (!feof($fp)) $terms .= fgets($fp, 1024); 220 216 fclose($fp); 221 //$terms .= htmlentities($terms_text, ENT_QUOTES, 'cp1252')."</textarea>"; 222 $terms .= $terms_text."</textarea>"; 223 217 $terms .= "</textarea>"; 224 218 225 219 makebutton($lang_register['create_acc_button'], "javascript:answerBox('{$lang_register['terms']}<br />$terms', 'javascript:do_submit_data()')",150); … … 239 233 global $lang_register, $lang_global, $output; 240 234 $output .= "<center> 241 <fieldset style=\"width: 550px;\">235 <fieldset class=\"half_frame\"> 242 236 <legend>{$lang_register['recover_acc_password']}</legend> 243 237 <form method=\"post\" action=\"register.php?action=do_pass_recovery\" name=\"form\"> … … 306 300 $body = str_replace("<password>", substr(sha1(strtoupper($user_name)),0,7), $body); 307 301 $body = str_replace("<activate_link>", 308 $_SERVER['HTTP_HOST']. substr($_SERVER["SCRIPT_NAME"], 0, strrpos($_SERVER["SCRIPT_NAME"], '/'))."/register.php?action=do_pass_activate&h=".$sql->result($result, 0, 'I')."&p=".substr(sha1(strtoupper($user_name)),0,7), $body);302 $_SERVER['HTTP_HOST']."/register.php?action=do_pass_activate&h=".$sql->result($result, 0, 'I')."&p=".substr(sha1(strtoupper($user_name)),0,7), $body); 309 303 $body = str_replace("<base_url>", $_SERVER['HTTP_HOST'], $body); 310 304
Note:
See TracChangeset
for help on using the changeset viewer.