Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //common.php
- <?php
- function get_from_mangosconf($configvalue,$id){ // Get Config values FROM mangos conf file. $configvalue should be name of config. $id is ID of realm ( config array value )
- global $MW;
- $init = 'id_'.$id;
- $mangosconf = file((string)$MW->getConfig->mangos_conf_external->$init->mangos_world_conf);
- foreach ($mangosconf as $line_num){
- $line_num = (string)$line_num;
- if (strstr($line_num,$configvalue) == TRUE){
- $arr = explode(' = ', $line_num);
- return str_replace("\r","",str_replace("\n","",$arr['1']));
- }
- }
- }
- function sha_password($user,$pass){
- $user = strtoupper($user);
- $pass = strtoupper($pass);
- return SHA1($user.':'.$pass);
- }
- function check_for_symbols($string, $space_check = 0){
- //$space_check=1 means space is not allowed
- $len=strlen($string);
- $allowed_chars="abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ0123456789";
- if(!$space_check) {
- $allowed_chars .= " ";
- }
- for($i=0;$i<$len;$i++)
- if(strstr($allowed_chars,$string[$i]) == FALSE)
- return TRUE;
- return FALSE;
- }
- function get_banned($account_id,$returncont){
- global $DB;
- $get_last_ip = $DB->selectCell("SELECT last_ip FROM account WHERE id='".$account_id."'");
- $db_IP = $get_last_ip;
- $ip_check = $DB->selectCell("SELECT ip FROM `ip_banned` WHERE ip='".$db_IP."'");
- if ($ip_check == FALSE){
- if ($returncont == "1"){
- return FALSE;
- }
- }
- else{
- if ($returncont == "1"){
- return TRUE;
- }
- else{
- return $db_IP;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement