Ignore:
Timestamp:
Dec 31, 2007, 3:20:15 PM (17 years ago)
Author:
george
Message:

Oprava: Odkaz na obnovu hesla a blokování registrace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • minimanager/register.php

    r178 r184  
    1515function doregister(){
    1616 global $lang_global, $realm_db, $disable_acc_creation, $limit_acc_per_ip, $valid_ip_mask,
    17                 $send_mail_on_creation, $create_acc_locked, $from_mail, $mailer_type, $smtp_cfg, $title;
     17                $send_mail_on_creation, $create_acc_locked, $from_mail, $mailer_type, $smtp_cfg, $title, $MaximumAccountCount;
    1818
    1919 if ( empty($_POST['pass']) || empty($_POST['email']) || empty($_POST['username']) ) {
    2020   redirect("register.php?err=1");
    2121 }
     22
     23 $sql = new SQL;
     24 $sql->connect($realm_db['addr'], $realm_db['user'], $realm_db['pass'], $realm_db['name']);
     25
     26  $result = $sql->query("SELECT COUNT(*) FROM account");
     27  $AccountCount = $sql->result($result, 0, 'COUNT(*)');
     28  if($AccountCount >= $MaximumAccountCount) redirect("register.php?err=4");
    2229
    2330 if ($disable_acc_creation) redirect("register.php?err=4");
     
    300307        $body = str_replace("<password>", substr(sha1(strtoupper($user_name)),0,7), $body);
    301308        $body = str_replace("<activate_link>",
    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);
     309                $_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);
    303310        $body = str_replace("<base_url>", $_SERVER['HTTP_HOST'], $body);
    304311
Note: See TracChangeset for help on using the changeset viewer.