Changeset 73


Ignore:
Timestamp:
Sep 15, 2007, 9:59:22 PM (17 years ago)
Author:
george
Message:

Oprava: Omezení registrací během dne podle počtu účtů.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • minimanager/register.php

    r60 r73  
    1313// DO REGISTER
    1414//#####################################################################################################
    15 function doregister(){
     15function doregister()
     16{
    1617 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;
     18                $send_mail_on_creation, $create_acc_locked, $from_mail, $mailer_type, $smtp_cfg, $title, $MaximumAccountCount;
    1819
    1920 if ( empty($_POST['pass']) || empty($_POST['email']) || empty($_POST['username']) ) {
     
    2122 }
    2223
     24 $result = $sql->query("SELECT COUNT(*) FROM account");
     25 $AccountCount = $sql->result($result, 0, 'COUNT(*)');
     26 if($AccountCount > $MaximumAccountCount) redirect("register.php?err=4");
     27 
    2328 if ($disable_acc_creation) redirect("register.php?err=4");
    2429
  • minimanager/scripts/config.sample.php

    r67 r73  
    7272//---- New account creation Options ----
    7373if($AllowedRegistrationCountPerDay == 0) $disable_acc_creation = true;  //true = Do not allow new accounts to be created
    74 else $disable_acc_creation = false;
     74else $disable_acc_creation = false;
     75//$MaximumAccountCount = 10000; // Total account count limitation
     76
    7577$send_mail_on_creation = false; //true = send mail at account creation.
    7678$create_acc_locked = 0;                 //if set to '1' newly created accounts will be made locked to 0.0.0.0 IP disallowing user to login.
  • registrace/check_registration.php

    r67 r73  
    11<?php
    22include('../global.php');
     3
     4$Database->select_db('realmd');
     5$DbResult = $Database->query('SELECT COUNT(*) FROM account');
     6$Row = $DbResult->fetch_array();
     7$AccountCount = $Row[0];
    38
    49$Database->select_db('statistic');
     
    1318fputs($ConfigFile, '$AllowedRegistrationCountPerDay = '.$AllowedRegistrationCountPerDay.';'."\n");
    1419fputs($ConfigFile, '$YesterdayMaxPlayers = '.$YesterdayMaxPlayers.'; '."\n");
     20fputs($ConfigFile, '$MaximumAccountCount = '.($AccountCount+$AllowedRegistrationCountPerDay).'; '."\n");
    1521fputs($ConfigFile, '?>'."\n");
    1622fclose($ConfigFile);
  • registrace/reg_config.php

    r67 r73  
    22$AllowedRegistrationCountPerDay = 0;
    33$YesterdayMaxPlayers = 91;
     4$MaximumAccountnCount = 0;
    45?>
Note: See TracChangeset for help on using the changeset viewer.