Ignore:
Timestamp:
Nov 23, 2007, 11:29:33 PM (17 years ago)
Author:
george
Message:

Minimanager 0.1.5b

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/register.php

    r131 r142  
    1313// DO REGISTER
    1414//#####################################################################################################
    15 function doregister()
    16 {
     15function doregister(){
    1716 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;
    1918
    2019 if ( empty($_POST['pass']) || empty($_POST['email']) || empty($_POST['username']) ) {
     
    2221 }
    2322
    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  
    3123 if ($disable_acc_creation) redirect("register.php?err=4");
    3224
     
    5850 }
    5951 
     52        $sql = new SQL;
     53        $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
    6054       
    6155        $user_name = $sql->quote_smart(trim($_POST['username']));
     
    162156                                alert('{$lang_register['diff_pass_entered']}');
    163157                                return;
     158                        } else if (document.form.pass1.value.length > 225){
     159                                alert('{$lang_register['pass_too_long']}');
     160                                return;
    164161                        } else {
    165162                                document.form.pass.value = hex_sha1(document.form.username.value.toUpperCase()+':'+document.form.pass1.value.toUpperCase());
     
    172169                answerbox.btn_icon='';
    173170        </script>
    174         <fieldset style=\"width: 550px;\">
     171        <fieldset class=\"half_frame\">
    175172        <legend>{$lang_register['create_acc']}</legend>
    176173        <form method=\"post\" action=\"register.php?action=doregister\" name=\"form\">
     
    215212               
    216213        $terms = "<textarea rows=\'18\' cols=\'80\' readonly=\'readonly\'>";
    217         $terms_text = '';
    218214        $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);
    220216        fclose($fp);
    221         //$terms .= htmlentities($terms_text, ENT_QUOTES, 'cp1252')."</textarea>";
    222         $terms .= $terms_text."</textarea>";
    223        
     217        $terms .= "</textarea>";
    224218
    225219                makebutton($lang_register['create_acc_button'], "javascript:answerBox('{$lang_register['terms']}<br />$terms', 'javascript:do_submit_data()')",150);
     
    239233 global $lang_register, $lang_global, $output;
    240234 $output .= "<center>
    241         <fieldset style=\"width: 550px;\">
     235        <fieldset class=\"half_frame\">
    242236        <legend>{$lang_register['recover_acc_password']}</legend>
    243237        <form method=\"post\" action=\"register.php?action=do_pass_recovery\" name=\"form\">
     
    306300        $body = str_replace("<password>", substr(sha1(strtoupper($user_name)),0,7), $body);
    307301        $body = str_replace("<activate_link>",
    308                 $_SERVER['HTTP_HOST'].substr($_SERVER["SCRIPT_NAME"], 0, strrpos($_SERVER["SCRIPT_NAME"], '/'))."/register.php?action=do_pass_activate&amp;h=".$sql->result($result, 0, 'I')."&amp;p=".substr(sha1(strtoupper($user_name)),0,7), $body);
     302                $_SERVER['HTTP_HOST']."/register.php?action=do_pass_activate&amp;h=".$sql->result($result, 0, 'I')."&amp;p=".substr(sha1(strtoupper($user_name)),0,7), $body);
    309303        $body = str_replace("<base_url>", $_SERVER['HTTP_HOST'], $body);
    310304
Note: See TracChangeset for help on using the changeset viewer.