Beispiel #1
0
            break;
        case '11':
            if (preg_match('/[\\\\"\\/]+/is', $p) || strlen($p) < 1) {
                ajax_die("alert('Недопустимое имя директории.');");
            }
            if (file_exists($fl . '/' . $p)) {
                ajax_die("alert('Директория с таким именем уже существует в каталоге.');");
            }
            if (@mkdir($fl . '/' . $p)) {
                ajax_die("alert('Директория успешно создана.');getDir(\"" . str_replace('\\', '/', myconv($fl)) . "\");document.getElementById('newdir').value='';");
            } else {
                ajax_die("alert('Ошибка при создании директории.');");
            }
            break;
        default:
            ajax_die("alert('Недопустимое действие.');");
    }
}
header("Content-type: text/html; charset=utf-8");
print <<<HERE
<html><head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>DX ajax text shell (ATS) {$ver}</title>
<style>
table
{
border-width:1px;
border-style:solid;
border-color:gray;
border-collapse:collapse;
}
Beispiel #2
0
/**
 * Draw a message box with the specified border color, then die cleanly
 *
 * @param string $text | The message to display inside the box
 * @param string $title | The box title (default = 'Message')
 * @param string $style | The border style (default = sred)
 */
function roster_die($text, $title = 'Message', $style = 'sred')
{
    global $roster;
    if ($roster->pages[0] == 'ajax') {
        ajax_die($text, $title, null, null, null);
    }
    // Set scope to util
    $roster->scope = 'util';
    if (!defined('ROSTER_MENU_INC') && is_array($roster->config)) {
        $roster_menu = new RosterMenu();
        $roster_menu->makeMenu($roster->output['show_menu']);
    }
    if (!defined('ROSTER_HEADER_INC') && is_array($roster->config)) {
        include_once ROSTER_BASE . 'header.php';
    }
    $roster_menu->displayMenu();
    echo messagebox($text, $title, $style);
    if (!defined('ROSTER_FOOTER_INC') && is_array($roster->config)) {
        include_once ROSTER_BASE . 'footer.php';
    }
    if (is_object($roster->db)) {
        $roster->db->close_db();
    }
    exit;
}
/**
 * Draw a message box with the specified border color, then die cleanly
 *
 * @param string $message | The message to display inside the box
 * @param string $title | The box title (default = 'Message')
 * @param string $style | The border style (default = sred)
 */
function roster_die($message, $title = 'Message', $style = 'sred')
{
    global $roster;
    if ($roster->pages[0] == 'ajax') {
        ajax_die($message, $title, null, null, null);
    }
    if (!defined('ROSTER_HEADER_INC') && is_array($roster->config)) {
        include_once ROSTER_BASE . 'header.php';
    }
    if (!defined('ROSTER_MENU_INC') && is_array($roster->config)) {
        $roster_menu = new RosterMenu();
        $roster_menu->makeMenu($roster->output['show_menu']);
    }
    if (is_object($roster->db)) {
        $roster->db->close_db();
    }
    echo messagebox('<div align="center">' . $message . '</div>', $title, $style);
    if (!defined('ROSTER_FOOTER_INC') && is_array($roster->config)) {
        include_once ROSTER_BASE . 'footer.php';
    }
    exit;
}