/**
 * Given some path, find any files that need to be excluded from code coverage (recursively)
 * @param string $path - The path to check in
 * @param SimpleXMLElement $node - The exclude node to add elements to
 * @return null
 */
function buildexcludes($path, $node)
{
    $dir = dir($path);
    $subdirs = array();
    while ($entry = $dir->read()) {
        if (strpos($entry, '.') === 0) {
            continue;
        }
        $sub = $path . '/' . $entry;
        if ($entry == '_manifest_exclude') {
            $exclude = $node->addChild('directory', $path);
            $exclude->addAttribute('suffix', '.php');
            return;
        }
        if (excluded($entry) || excluded($sub) || $entry == 'tests' || $entry == '_config.php' || $entry == 'cli-script.php' || preg_match('/main.php$/', $entry) || $entry == 'bootstrap.php') {
            if (is_dir($sub)) {
                $exclude = $node->addChild('directory', $sub);
                $exclude->addAttribute('suffix', '.php');
            } else {
                $exclude = $node->addChild('file', $sub);
            }
        } else {
            if (is_dir($sub)) {
                $subdirs[] = $sub;
            }
        }
    }
    foreach ($subdirs as $subdir) {
        buildexcludes($subdir, $node);
    }
}
Ejemplo n.º 2
0
         $password_set = sha1(str_rot13($new_password . $encryption));
         $mysqli->query("UPDATE users SET user_password = '******' WHERE user_name = '{$target}' AND user_id = '{$targetid}'");
         echo 1;
         die;
     } else {
         echo 10;
         die;
     }
 }
 // change user name
 if ($effect == 'name' && isset($_POST['newMname'])) {
     $nname = $mysqli->real_escape_string(trim($_POST['newMname']));
     $check_avail = $mysqli->query("SELECT user_name FROM users WHERE user_name =  '{$nname}'");
     if ($check_avail->num_rows < 1) {
         $nname_lower = strtolower($nname);
         if (preg_match("/^[a-zA-Z]{2,}[_-]?[a-zA-Z0-9]{2,}\$/", $nname) && strlen($nname) < $setting['max_username'] && !ctype_digit($nname) && excluded($exclude_in_username, $nname_lower) !== true && $nname !== $lang_system && strlen($nname) >= 4) {
             if (file_exists('../upload/' . $target)) {
                 rename('../upload/' . $target, '../upload/' . $nname);
             }
             $message_nick = "{$target} {$name_it} {$nname}";
             $mysqli->query("UPDATE users SET user_name = '{$nname}', old_name = '{$target}' WHERE user_name = '{$target}' AND user_id = '{$targetid}'");
             $mysqli->query("UPDATE `chat` SET `post_user` = '{$nname}' WHERE `post_user` = '{$target}'");
             $mysqli->query("UPDATE `private` SET `hunter` = '{$nname}' WHERE `hunter` = '{$target}'");
             $mysqli->query("UPDATE `private` SET `target` = '{$nname}' WHERE `target` = '{$target}'");
             $mysqli->query("UPDATE `friends` SET `target` = '{$nname}' WHERE `target` = '{$target}'");
             $mysqli->query("UPDATE `friends` SET `hunter` = '{$nname}' WHERE `hunter` = '{$target}'");
             $mysqli->query("INSERT INTO `chat` (post_date, post_time, user_id, post_user, post_message, post_roomid, post_color, type, avatar) VALUES ('{$time}', '{$post_time}', '999999', '{$lang_system}', '{$message_nick}', {$room}, 'bold', 'system', 'default_system_tumb.png')");
             echo "{$nname} ok1000";
             die;
         } else {
             echo 8;
Ejemplo n.º 3
0
         $reg_color = 'guest';
     } else {
         die;
     }
 }
 if ($setting['activation'] == 1 && $guest !== 1) {
     $validate = 0;
 } else {
     $validate = 1;
     $validation_key = "";
 }
 if (preg_match("/^[a-zA-Z]{2,}[_-]?[a-zA-Z0-9]{2,}\$/", $user_name) && strlen($user_name) < $setting['max_username'] && !ctype_digit($user_name)) {
     if (strlen($user_name) >= 4) {
         if ($user_info->num_rows < 1) {
             if ($check_email->num_rows < 1 || $setting['allow_email'] == 1) {
                 if (excluded($exclude_in_username, $user_name) !== true) {
                     if (filter_var($user_email, FILTER_VALIDATE_EMAIL)) {
                         if ($agree == 'true') {
                             $action = time();
                             $user_password = sha1(str_rot13($user_password . $encryption));
                             $set_admin = $mysqli->query("SELECT * FROM `users` WHERE `user_id` > '0'");
                             if ($set_admin->num_rows < 1) {
                                 $mysqli->query("INSERT INTO `users` (user_name, user_password, user_ip, user_email, last_action, user_roomid, user_rank, user_color, user_join, verified) VALUES ('{$user_name}', '{$user_password}', '{$user_ip}', '{$user_email}', '{$action}', '1', '5', 'sadmin', '{$action}', '1')") or die($mysqli->error);
                                 $mysqli->query("INSERT INTO `private` (time, target, hunter, message, target_color, hunter_color) VALUES ('{$time}', '{$user_name}', '{$lang_system}', '{$boomwelcome}', 'user', 'system')");
                                 setcookie("username", "{$user_name}", time() + 1000 * 1000 * 100);
                                 setcookie("password", "{$user_password}", time() + 1000 * 1000 * 100);
                                 $dirname = $user_name;
                                 $filename = "upload/" . $dirname . "/";
                                 if (!file_exists($filename)) {
                                     $oldmask = umask(0);
                                     mkdir("upload/" . $dirname, 0777);