コード例 #1
0
ファイル: login_theme.php プロジェクト: ashish2/resumer
function login_theme()
{
    global $globals, $mysql, $done, $error, $errors;
    global $l;
    error_handler($error);
    if ($done) {
        //echo $l['thanks'] . '<a href="index.php?action=login">Login</a> here';
        echo $l['redirection'];
    } else {
        echo '<center>';
        echo $l['test_login_msg'];
        // for input fields, pattern attribute,
        // pattern="^\(?\d{3}\)?[-\s]\d{3}[-\s]\d{4}.*?$"  , pattern to check, fone pattern format, such as, (555)-555-5555
        echo '
			<form action="" method="post">
				<table align="center">
					<tr>
						<td width="70%">' . $l['user_email'] . '</td>
						<td><input type="text" name="email" placeholder="For eg. a@a.com" required> </td>
					</tr>
					<tr>
						<td>' . $l['pass'] . '</td>
						<td><input type="password" name="password" required></td>
					</tr>
				</table>
				<br />
				<center><input type="submit" name="sub_register" value="Login"></center>
			</form>
			</center>
		';
    }
}
コード例 #2
0
ファイル: Comparator.php プロジェクト: ankhzet/Ankh
 public function compare(PageResolver $r1, PageResolver $r2)
 {
     $contents1 = PageUtils::contents($r1);
     $contents2 = PageUtils::contents($r2);
     if ($contents2 === null) {
         $fetch = app(Fetch::class);
         //todo: move this to Fetch constructor & make it configurable
         if (method_exists($fetch, 'cached')) {
             $fetch = $fetch->cached(false);
         }
         $contents2 = $fetch->pull($r2->page->absoluteLink());
         if (!$fetch->isOk()) {
             if ($fetch->code() == 404) {
                 $r2->page->delete();
                 return new EqualCompare($contents1, $this->size($contents1));
             } else {
                 throw new CompareFetchError($r2->page, $fetch->code());
             }
         }
         $size = $this->size($contents2);
         $contents2 = $this->cleanup($contents2);
         if (!PageUtils::putContents($r2, $contents2, $this->fetchedEncoding)) {
             error_handler(E_USER_ERROR, "Failed to save \"{$r2}\"", basename(__FILE__), 28);
             return false;
         }
         $contents2 = PageUtils::contents($r2);
     } else {
         $size = null;
     }
     return new Compare($contents1, $contents2, $size);
 }
コード例 #3
0
ファイル: list_theme.php プロジェクト: ashish2/resumer
function listUsers_theme()
{
    global $globals, $mysql, $theme, $done, $errors;
    global $user;
    global $q, $l;
    error_handler($errors);
    echo '<center>
	<h3>' . $l['list_users'] . '</h3>
	<table border="1">
		<tr id="disp_table">
			<td><b>' . $l['listing'] . '</td>
			<td><b>' . $l['uid'] . '</b></td>
			<td><b>' . $l['username'] . '</b></td>
			<td><b>' . $l['email'] . '</b></td>
			<td><b>' . $l['url'] . '</b></td>
			<td><b>' . $l['friend_uid'] . '</b></td>
		</tr>';
    $i = 1;
    while ($row = mysql_fetch_assoc($q)) {
        echo "\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{$i}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$row['uid']}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t<a href={$globals['boardurl']}{$globals['only_ind']}action=viewProfile&uid={$row['uid']}>{$row['username']}</a>\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$row['email']}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$row['url']}\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t{$row['friends_list']}\n\t\t\t</td>\n\t\t</tr>\n\t\t";
        $i++;
    }
    // setting $row as null, clearing/cleaning/emptying php memory
    $row = null;
    echo '</table>';
    /*
    echo '</table><br /><br />
    <a href="index.php?action=wall&uid='.$user['uid']. '">Wall</a> | 
    <a href="index.php?action=modifyprofile&uid='.$user['uid']. '">Modify Profile</a> | 
    <a href="index.php?action=ban&uid='.$user['uid']. '">Ban him!!!</a>
    </center>';
    */
}
コード例 #4
0
ファイル: login_theme.php プロジェクト: ashish2/resumer
function login_theme()
{
    global $globals, $mysql, $done, $error, $errors;
    global $l;
    error_handler($error);
    if ($done) {
        //echo $l['thanks'] . '<a href="index.php?action=login">Login</a> here';
        echo $l['redirection'];
    } else {
        echo '<center>';
        echo $l['test_login_msg'];
        echo '
			<form action="" method="post">
				<table align="center">
					<tr>
						<td width="70%">' . $l['user_email'] . '</td>
						<td><input type="text" name="email"> </td>
					</tr>
					<tr>
						<td>' . $l['pass'] . '</td>
						<td><input type="password" name="password"></td>
					</tr>
				</table>
				<br />
				<center><input type="submit" name="sub_register" value="Login"></center>
			</form>
			</center>
		';
    }
}
コード例 #5
0
ファイル: register_theme.php プロジェクト: ashish2/resumer
function register_theme()
{
    global $globals, $mysql, $done, $error;
    global $l;
    error_handler($error);
    // if exists, then 'email exists' error, etc. (still to put)
    if ($done) {
        echo $l['thanks'] . '<a href="index.php?action=login">' . $l['login'] . '</a> here';
    } else {
        echo '
			<form action="" method="post">
				<table align="center">
					<tr>
						<td width="70%">' . $l['usrnm'] . '</td>
						<td><input type="text" name="username" required> </td>
					</tr>
					<tr>
						<td>' . $l['pass'] . '</td>
						<td><input type="text" name="password" required></td>
					</tr>
					<tr>
						<td>' . $l['email'] . '</td>
						<td><input type="text" name="email" required> </td>
					</tr>
					<tr>
						<td>' . $l['web_url'] . '</td>
						<td><input type="text" name="url"> </td>
					</tr>
				</table>
				<center><input type="submit" name="sub_register" value="Register"></center>
			</form>
		';
    }
}
コード例 #6
0
ファイル: posts.php プロジェクト: a-i-ko93/ipl-foodblog
function shutdown()
{
    $error = error_get_last();
    if ($error['type'] === E_ERROR) {
        error_handler('', '', '', '');
    }
}
コード例 #7
0
ファイル: password_crypto.php プロジェクト: seans888/APC-CPO
function cobalt_password_hash_bcrypt($password, $salt, $iteration)
{
    //Deal with blowfish bug in PHP < 5.3.7
    if (PHP_VERSION_ID < 50307) {
        error_handler("Cobalt encountered an error during password processing.", "Cobalt Password Hash Error: Attempted to use bcrypt on onlder than PHP 5.3.7. This is a known security risk, and has been stopped. Please change preferred hashing method to an alternative. (SHA512 recommended)");
    } else {
        $blowfish_salt_start = '$2y$';
    }
    //make sure cost factor is two digit only and within the range 04-31, else crypt() will fail
    if ($iteration > 31) {
        $iteration = 31;
    }
    if ($iteration < 10) {
        $iteration = '0' . $iteration;
    }
    if ($iteration < 4) {
        $iteration = '04';
    }
    $blowfish_cost = $iteration;
    $blowfish_key = '$' . $salt . '$';
    $blowfish_key = str_replace('+', '.', $blowfish_key);
    //blowfish salt doesn't support + char
    $blowfish_salt = $blowfish_salt_start . $blowfish_cost . $blowfish_key;
    $digest = crypt($password . $salt, $blowfish_salt);
    return $digest;
}
コード例 #8
0
ファイル: messages_theme.php プロジェクト: ashish2/resumer
function sendMessage_theme()
{
    global $globals, $mysql, $theme, $done, $error, $errors;
    global $user;
    global $par;
    global $db;
    global $l;
    error_handler($error);
    echo '
		<form method="post" action="" name="form1">
			<table align="center" width="90%" border="0">
				<tr>
					<td width="30%">' . $l['to'] . '</td>
					<td><input type="text" name="to"> </td>
				</tr>' . '<tr>
					<td>' . $l['subj'] . '</td>
					<td><input type="text" name="subject"> </td>
				</tr>
				<tr>
					<td>' . $l['body'] . '</td>
					<td><textarea rows="15" cols="60" name="body"></textarea> </td>
				</tr>
			</table>
			<br />
			<br />
			<center>
				<input type="submit" id="sendMess" name="sendMess" value="Send Message">
			</center>
		</form>
	';
}
コード例 #9
0
ファイル: Errores.php プロジェクト: hcvcastro/pxp
function fatalErrorShutdownHandler()
{
    $last_error = error_get_last();
    if ($last_error['type'] === E_ERROR || $last_error['type'] === E_PARSE) {
        error_handler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']);
    }
}
コード例 #10
0
 public function index($image_name)
 {
     $file_path = APP_ROOT . "/img/" . "{$image_name}";
     $file_info = pathinfo($file_path);
     switch ($file_info["extension"]) {
         case 'bmp':
             header('Content-Type: image/bmp');
             break;
         case 'gif':
             header('Content-Type: image/gif');
             break;
         case 'jpg':
             header('Content-Type: image/jpeg');
             break;
         case 'jpeg':
             header('Content-Type: image/jpeg');
             break;
         case 'png':
             header('Content-Type: image/png');
             break;
         default:
             error_handler("Create_thumb: Unsupported picture type: " . $src . "--" . $type);
             return;
     }
     $fp = fopen($file_path, 'r');
     fpassthru($fp);
 }
コード例 #11
0
ファイル: catcherror.php プロジェクト: goXXip/mihalismmh
function shutdown_error_handler()
{
    $error = error_get_last();
    if (empty($error) === false) {
        error_handler($error['type'], $error['message'], $error['file'], $error['line']);
    }
}
コード例 #12
0
function login()
{
    global $error;
    if (isset($_GET['error'])) {
        error_handler($_GET['error']);
    }
    if (!isset($_POST['username']) or !isset($_POST['password'])) {
        return false;
    }
    $username = $_POST['username'];
    $password = $_POST['password'];
    if (empty($username) and empty($password)) {
        $error = 'You did not fill out all forms. Do so please.';
        return false;
    }
    if (!filter_var($username, FILTER_VALIDATE_EMAIL)) {
        $error = 'This is not an email, please fill in an email-address.';
        return false;
    }
    $user = query('SELECT id FROM users WHERE email = "' . $username . '" AND password = "******" ');
    if ($_POST["vercode"] != $_SESSION["vercode"] or $_SESSION["vercode"] == '') {
        echo '<strong>Wrong verification code.</strong>';
    } else {
        if (count($user) < 1) {
            $error = 'Wrong email, password or verification code.';
            return false;
        }
    }
    $_SESSION['id'] = $user[0]['id'];
    header('Location: ../views/resultpage.php');
    exit;
}
コード例 #13
0
ファイル: compiler.php プロジェクト: hackingman/TradeX
 function ErrorHandler($errno, $errstr, $errfile, $errline)
 {
     if ($errno == E_USER_NOTICE) {
         $this->errors[] = $errstr;
     } else {
         error_handler($errno, $errstr, $errfile, $errline);
     }
 }
コード例 #14
0
ファイル: bannedList_theme.php プロジェクト: ashish2/resumer
function ban_theme()
{
    global $globals, $mysql, $theme, $done, $error, $errors, $l;
    // Get all data of the user, whether to allow
    // him to view or enter the board.
    // user level, user permissions
    global $user, $notice;
    global $board, $replies;
    global $qu;
    // boards will be listed here, get data from DB
    // Board table, having, board_id, board_name, board_desc,
    // user_id who started board(admin or moderator),
    // number of replies in Reply table
    // who replied etc, replies to a board_id in reply table
    // name of board, which username started board,
    // how many posts in board
    error_handler($error);
    if (!empty($notice)) {
        notice_handler($notice);
        return;
    }
    if ($qu) {
        echo '
			<center>
			<table border="1" >
				<tr id="disp_table">
					<td>
						' . $l['ban_uid'] . '
					</td>
					<td>
						' . $l['ban_uname'] . '
					</td>
				</tr>
			';
        for (; $i = mysql_fetch_assoc($qu);) {
            echo '
				<tr>
					<td>
						' . $i['ban_uid'] . '
					</td>
					<td>
						' . $i['username'] . '
					</td>
				</tr>';
        }
        echo '
			</table>
			</center>
		';
    } else {
        noData();
    }
}
コード例 #15
0
ファイル: login_theme.php プロジェクト: ashish2/resumer
function login_theme()
{
    global $globals, $mysql, $done, $error;
    global $l;
    error_handler($error);
    if ($done) {
        echo $l['thanks'] . '<a href="index.php?action=login">Login</a> here';
    } else {
        echo '
			<form action="" method="post">
				<div class="fieldContainer">
					
					<div class="formRow">
						<div class="label">
							<label for="name">Name: </label>
						</div>
						<div class="field">
							<input type="text" name="name">
						</div>
						
					</div>
					
				</div>
				
				<div class="signupButton">
					<center>
						<input type="submit" name="sub_register" value="Login">
					</center>
				</div>
				
			</form>
		';
        /*
        echo '
        	<form action="" method="post">
        		<table align="center">
        			<tr>
        				<td width="70%"> Username/Email </td>
        				<td><input type="text" name="email"> </td>
        			</tr>
        			<tr>
        				<td>Password</td>
        				<td><input type="text" name="password"></td>
        			</tr>
        		</table>
        		<br />
        		<center><input type="submit" name="sub_register" value="Login"></center>
        	</form>
        ';
        */
    }
}
コード例 #16
0
ファイル: errors.php プロジェクト: scuba323/dcoin
/**
 * Функция перехвата фатальных ошибок
 */
function fatal_error_handler()
{
    // если была ошибка и она фатальна
    if ($error = error_get_last() and $error['type'] & (E_ERROR | E_PARSE | E_COMPILE_ERROR | E_CORE_ERROR)) {
        // очищаем буффер (не выводим стандартное сообщение об ошибке)
        ob_end_clean();
        // запускаем обработчик ошибок
        error_handler($error['type'], $error['message'], $error['file'], $error['line']);
    } else {
        // отправка (вывод) буфера и его отключение
        ob_end_flush();
    }
}
コード例 #17
0
ファイル: quiz.php プロジェクト: p2004a/CTF
function check_for_fatal_error()
{
    $error = error_get_last();
    $isError = false;
    switch ($error['type']) {
        case E_ERROR:
        case E_CORE_ERROR:
        case E_PARSE:
        case E_COMPILE_ERROR:
        case E_USER_ERROR:
            error_handler($error["type"], $error["message"], $error["file"], $error["line"]);
    }
}
コード例 #18
0
ファイル: admin_theme.php プロジェクト: ashish2/resumer
function adminMain_theme()
{
    global $globals, $mysql, $theme, $done, $errors;
    global $user;
    global $q, $l;
    if ($errors) {
        error_handler($errors);
        return false;
    }
    echo 'Welcome to the Admin Section...! Still Work in Progress...';
    echbr(2);
    echo '<a href="index.php?action=listUsers">' . $l['l_users'] . '</a>';
}
コード例 #19
0
function fatalErrorShutdownHandler()
{
    $last_error = error_get_last();
    if ($last_error['type'] === E_ERROR || $last_error['type'] === E_PARSE) {
        global $_handled_errors;
        // fatal error
        error_handler(E_ERROR, $last_error['message'], $last_error['file'], $last_error['line']);
        if (!empty($_handled_errors)) {
            @ob_clean();
            echo json_encode($_handled_errors);
            logErrors(new \ErrorException($last_error['message'], 0, 1, $last_error['file'], $last_error['line']), 500);
        }
        header("HTTP/1.0 500 Service not available");
    }
}
コード例 #20
0
ファイル: tasks.php プロジェクト: mtechnik/pantherforum
 public function run($task_id)
 {
     $this->task = $this->panther_tasks[$task_id];
     if (!preg_match('/^[a-z-_0-9]+$/i', $this->task['script']) || !file_exists(PANTHER_ROOT . 'include/tasks/' . $this->task['script'] . '.php')) {
         error_handler(E_ERROR, 'Invalid task name or task does not exist', __FILE__, __LINE__);
     }
     if ($this->task['locked']) {
         return;
     }
     // Lock the task so it can't be ran twice
     $this->lock();
     $task_name = 'task_' . $this->task['script'];
     if (!class_exists($task_name)) {
         require PANTHER_ROOT . 'include/tasks/' . $this->task['script'] . '.php';
         $task = new $task_name($this->db, $this->panther_config, $this->updater);
     }
     $this->lock(0);
 }
コード例 #21
0
ファイル: friends_theme.php プロジェクト: ashish2/resumer
function friendsList_theme()
{
    global $globals, $mysql, $done, $error, $errors, $notice;
    global $l, $notice, $qu;
    global $show;
    error_handler($error);
    notice_handler($notice);
    $str = '';
    if ($show) {
        if (mysql_num_rows($qu) > 0) {
            $str .= '<center><div><b>' . $l['frnds'] . '</b> <br />';
            while ($row = mysql_fetch_assoc($qu)) {
                $str .= "<p>" . null . "<span>\n\t\t\t\t\t\t{$row['username']} | \n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{$row['email']} | \n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{$row['url']} \n\t\t\t\t\t</span>\n\t\t\t\t</p>";
            }
            $str .= '</div></center>';
        }
    }
    echo $str;
}
コード例 #22
0
ファイル: list_theme.php プロジェクト: ashish2/resumer
function listUsers_theme()
{
    global $globals, $mysql, $theme, $done, $errors;
    global $user;
    global $q, $l;
    error_handler($errors);
    $cssThClassNm = 'class="dt-header"';
    $cssTrClassNm = 'class="dth-wp_post-tr"';
    $cssTdClassNm = 'class="dth-wp_post"';
    $table = '';
    $table .= '<center>
	<h3>' . $l['list_users'] . '</h3>
	<table class="disp_table" id="disp_table">
		<thead>
			<tr>
				<th ' . $cssThClassNm . '><b>' . $l['listing'] . '</th>
				<th ' . $cssThClassNm . '><b>' . $l['uid'] . '</b></th>
				<th ' . $cssThClassNm . '><b>' . $l['username'] . '</b></th>
				<th ' . $cssThClassNm . '><b>' . $l['email'] . '</b></th>
				<th ' . $cssThClassNm . '><b>' . $l['url'] . '</b></th>
				<th ' . $cssThClassNm . '><b>' . $l['friend_uid'] . '</b></th>
			</tr>
		<thead>';
    $i = 1;
    while ($row = mysql_fetch_assoc($q)) {
        $table .= "\n\t\t<tr {$cssTrClassNm}>\n\t\t\t<td {$cssTdClassNm}>\n\t\t\t\t{$i}\n\t\t\t</td>\n\t\t\t<td {$cssTdClassNm}>\n\t\t\t\t{$row['uid']}\n\t\t\t</td>\n\t\t\t<td {$cssTdClassNm}>\n\t\t\t\t<a href={$globals['boardurl']}{$globals['only_ind']}action=viewProfile&uid={$row['uid']}>{$row['username']}</a>\n\t\t\t</td>\n\t\t\t<td {$cssTdClassNm}>\n\t\t\t\t{$row['email']}\n\t\t\t</td>\n\t\t\t<td {$cssTdClassNm}>\n\t\t\t\t{$row['url']}\n\t\t\t</td>\n\t\t\t<td {$cssTdClassNm}>\n\t\t\t\t{$row['friends_list']}\n\t\t\t</td>\n\t\t</tr>\n\t\t";
        $i++;
    }
    // setting $row as null, clearing/cleaning/emptying php memory
    $row = null;
    $table .= '</table>';
    echo $table;
    // emptying table
    $table = '';
    /*
    echo '</table><br /><br />
    <a href="index.php?action=wall&uid='.$user['uid']. '">Wall</a> | 
    <a href="index.php?action=modifyprofile&uid='.$user['uid']. '">Modify Profile</a> | 
    <a href="index.php?action=ban&uid='.$user['uid']. '">Ban him!!!</a>
    </center>';
    */
}
コード例 #23
0
ファイル: addReply_theme.php プロジェクト: ashish2/resumer
function addReply_theme()
{
    global $globals, $mysql, $theme, $done, $errors, $error, $notice;
    // Get all data of the user, whether to allow
    // him to view or enter the board.
    // user level, user permissions
    global $user, $l;
    global $board, $replies, $row;
    // boards will be listed here, get data from DB
    // Board table, having, board_id, board_name, board_desc,
    // user_id who started board(admin or moderator),
    // number of replies in Reply table
    // who replied etc, replies to a board_id in reply table
    // name of board, which username started board,
    // how many posts in board
    error_handler($error);
    notice_handler($notice);
    $subject = '';
    // if not isset $_GET[post], that means it is not a createTopic, it only an addReply
    // if isset $_GET[post], that means it is a createTopic event
    if (!isset($_GET['post'])) {
        $subject = '<tr>
					<td valign="center">' . $l['subj'] . '</td>
					<td><input type="text" name="subject" value="Re: ' . $row['tname'] . '"></td>
			</tr>';
    }
    echo '
		<form method="post" action="">
			<table align="center">
			' . $subject . '
					<tr>
						<td valign="top">' . $l['reply'] . '</td>
						<td><textarea name="reply" rows="6" cols="35"></textarea></td>
					</tr>
				</table>
			<center><input class="mun-button-default" type="submit" name="reply_sub" value="Reply"></center>
		</form>
	';
}
コード例 #24
0
function the_whatpage_theme()
{
    global $globals, $mysql, $theme, $done, $error, $errors;
    global $user, $privs, $row;
    global $q, $q1;
    global $endpage_msg;
    error_handler($errors);
    //error_handler($endpage_msg);
    error_handler($endpage_msg);
    if (!userLoggedIn()) {
        return false;
    }
    if (!empty($errors) || !empty($endpage_msg)) {
        return false;
    }
    //		isAllowedTo();
    echo '<center>';
    echo '<h1>What?</h1>';
    echo '<h2>Which page is this, huh?</h2>';
    echo '<h3>Which page did you want, hunh!!!</h3>';
    echo '<h3>Redirecting you to the index page, lol :P :)</h3>';
    //echo '<h3>Awrite Cowboy, redirecting you to the index page, :P lol :)</h3>';
    echo '</center>';
}
コード例 #25
0
function print_checker_results()
{
    global $config, $lang;
    $aspell_err = "";
    if ($config['pspell'] == 'pspell') {
        include 'classes/spellchecker/pspell.class.php';
    } elseif ($config['pspell'] == 'mysql') {
        include 'classes/spellchecker/mysql.class.php';
        global $db;
        $path = $db;
    } else {
        include 'classes/spellchecker/php.class.php';
        $path = 'classes/spellchecker/dict/';
    }
    $sc = new spellchecker($lang->phrase('spellcheck_dict'), $config['spellcheck_ignore'], $config['spellcheck_mode'], TRUE);
    if (isset($path)) {
        $sc->set_path($path);
    }
    $sc->init();
    $x = $sc->error();
    if (!empty($x)) {
        $aspell_err .= $sc->error();
    } else {
        $count = count($_POST['textinputs']);
        for ($i = 0; $i < $count; $i++) {
            $text = @utf8_decode(urldecode($_POST['textinputs'][$i]));
            $lines = explode("\n", $text);
            print_textindex_decl($i);
            $index = 0;
            foreach ($lines as $value) {
                $b1 = t1();
                $mistakes = $sc->check_text($value);
                $suggestions = $sc->suggest_text($mistakes);
                foreach ($mistakes as $word) {
                    print_words_elem($word, $index, $i);
                    print_suggs_elem($suggestions[$word], $index, $i);
                    $index++;
                }
            }
        }
    }
    if (!empty($aspell_err)) {
        $aspell_err = "Error executing {$config['pspell']}:\\n{$aspell_err}";
        error_handler($aspell_err);
    }
    @file_put_contents('temp/spellchecker_benchmark.dat', $sc->benchmark());
}
コード例 #26
0
ファイル: stdinc.php プロジェクト: BackupTheBerlios/freja-svn
function exception_handler($ex)
{
    error_handler($ex->getCode(), $ex->getMessage(), $ex->getFile(), $ex->getLine());
}
コード例 #27
0
ファイル: spellchecker.php プロジェクト: propagit/skfest
function print_checker_results()
{
    global $aspell_prog;
    global $aspell_opts;
    global $tempfiledir;
    global $textinputs;
    global $input_separator;
    $aspell_err = "";
    # create temp file
    $tempfile = tempnam($tempfiledir, 'aspell_data_');
    # open temp file, add the submitted text.
    if ($fh = fopen($tempfile, 'w')) {
        for ($i = 0; $i < count($textinputs); $i++) {
            $text = urldecode($textinputs[$i]);
            $lines = explode("\n", $text);
            fwrite($fh, "%\n");
            # exit terse mode
            fwrite($fh, "^{$input_separator}\n");
            fwrite($fh, "!\n");
            # enter terse mode
            foreach ($lines as $key => $value) {
                # use carat on each line to escape possible aspell commands
                fwrite($fh, "^{$value}\n");
            }
        }
        fclose($fh);
        # exec aspell command - redirect STDERR to STDOUT
        $cmd = "{$aspell_prog} {$aspell_opts} < {$tempfile} 2>&1";
        if ($aspellret = shell_exec($cmd)) {
            $linesout = explode("\n", $aspellret);
            $index = 0;
            $text_input_index = -1;
            # parse each line of aspell return
            foreach ($linesout as $key => $val) {
                $chardesc = substr($val, 0, 1);
                # if '&', then not in dictionary but has suggestions
                # if '#', then not in dictionary and no suggestions
                # if '*', then it is a delimiter between text inputs
                # if '@' then version info
                if ($chardesc == '&' || $chardesc == '#') {
                    $line = explode(" ", $val, 5);
                    print_words_elem($line[1], $index, $text_input_index);
                    if (isset($line[4])) {
                        $suggs = explode(", ", $line[4]);
                    } else {
                        $suggs = array();
                    }
                    print_suggs_elem($suggs, $index, $text_input_index);
                    $index++;
                } elseif ($chardesc == '*') {
                    $text_input_index++;
                    print_textindex_decl($text_input_index);
                    $index = 0;
                } elseif ($chardesc != '@' && $chardesc != "") {
                    # assume this is error output
                    $aspell_err .= $val;
                }
            }
            if ($aspell_err) {
                $aspell_err = "Error executing `{$cmd}`\\n{$aspell_err}";
                error_handler($aspell_err);
            }
        } else {
            error_handler("System error: Aspell program execution failed (`{$cmd}`)");
        }
    } else {
        error_handler("System error: Could not open file '{$tempfile}' for writing");
    }
    # close temp file, delete file
    unlink($tempfile);
}
コード例 #28
0
        $record = 'record';
    } else {
        $record = 'records';
    }
    $a = 1;
    while ($row = $result->fetch_assoc()) {
        if ($a % 2 == 0) {
            $class = 'listRowEven';
        } else {
            $class = 'listRowOdd';
        }
        $a++;
        extract($row);
        echo '<tr class="' . $class . '">
                    <td>' . cobalt_htmlentities($entry_id) . '</td>
                    <td>' . cobalt_htmlentities($ip_address) . '</td>
                    <td>' . cobalt_htmlentities($user) . '</td>
                    <td>' . date("l, F d, Y -- h:i:s a", $datetime) . '</td>
                    <td>' . nl2br(cobalt_htmlentities($action)) . '</td>
                    <td>' . cobalt_htmlentities($module) . '</td> </tr>' . "\n";
    }
    $result->close();
} else {
    error_handler("Error getting log entries: ", "Query: " . $data_con->query . " -----Error: " . $data_con->error);
}
?>
</table>
</FORM>
</fieldset>
<?php 
$html_writer->draw_footer();
コード例 #29
0
ファイル: authors.php プロジェクト: npds/npds_dune
function updateadmin($chng_aid, $chng_name, $chng_email, $chng_url, $chng_radminfilem, $chng_radminsuper, $chng_pwd, $chng_pwd2, $temp_system_md5)
{
    global $NPDS_Prefix, $modu;
    if (!($chng_aid && $chng_name && $chng_email)) {
        Header("Location: admin.php?op=mod_authors");
    }
    // Gestion du fichier pour filemanager
    $result = sql_query("SELECT radminfilem,radminsuper FROM " . $NPDS_Prefix . "authors WHERE aid='{$chng_aid}'");
    list($ori_radminfilem, $ori_radminsuper) = sql_fetch_row($result);
    if ($ori_radminsuper and !$chng_radminsuper) {
        @unlink("modules/f-manager/users/" . strtolower($chng_aid) . ".conf.php");
    }
    if (!$ori_radminsuper and $chng_radminsuper) {
        @copy("modules/f-manager/users/modele.admin.conf.php", "modules/f-manager/users/" . strtolower($chng_aid) . ".conf.php");
    }
    if ($ori_radminfilem and !$chng_radminfilem) {
        @unlink("modules/f-manager/users/" . strtolower($chng_aid) . ".conf.php");
    }
    if (!$ori_radminfilem and $chng_radminfilem) {
        @copy("modules/f-manager/users/modele.admin.conf.php", "modules/f-manager/users/" . strtolower($chng_aid) . ".conf.php");
    }
    if ($chng_pwd2 != '') {
        if ($chng_pwd != $chng_pwd2) {
            global $hlpfile;
            include "header.php";
            GraphicAdmin($hlpfile);
            echo error_handler(adm_translate("Désolé, les nouveaux Mots de Passe ne correspondent pas. Cliquez sur retour et recommencez") . "<br />");
            include "footer.php";
            exit;
        }
        global $system_md5;
        if ($system_md5 or $temp_system_md5) {
            $chng_pwd = crypt($chng_pwd2, $chng_pwd);
        }
        if ($chng_radminsuper == 1) {
            $result = sql_query("UPDATE " . $NPDS_Prefix . "authors SET name='{$chng_name}', email='{$chng_email}', url='{$chng_url}', radminfilem='0', radminsuper='{$chng_radminsuper}', pwd='{$chng_pwd}' WHERE aid='{$chng_aid}'");
        } else {
            $result = sql_query("UPDATE " . $NPDS_Prefix . "authors SET name='{$chng_name}', email='{$chng_email}', url='{$chng_url}', radminfilem='{$chng_radminfilem}', radminsuper='0', pwd='{$chng_pwd}' WHERE aid='{$chng_aid}'");
        }
    } else {
        if ($chng_radminsuper == 1) {
            $result = sql_query("UPDATE " . $NPDS_Prefix . "authors SET name='{$chng_name}', email='{$chng_email}', url='{$chng_url}', radminfilem='0', radminsuper='{$chng_radminsuper}' WHERE aid='{$chng_aid}'");
            deletedroits($chng_aid);
        } else {
            $result = sql_query("UPDATE " . $NPDS_Prefix . "authors SET name='{$chng_name}', email='{$chng_email}', url='{$chng_url}', radminfilem='{$chng_radminfilem}', radminsuper='0' WHERE aid='{$chng_aid}'");
            deletedroits($chng_aid);
            updatedroits($chng_aid);
        }
    }
    global $aid;
    Ecr_Log('security', "ModifyAuthor({$chng_name}) by AID : {$aid}", '');
    Header("Location: admin.php?op=mod_authors");
}
コード例 #30
0
function fatal_error_handler()
{
    $last_error = error_get_last();
    error_handler($last_error['type'], $last_error['message'], $last_error['file'], $last_error['line']);
}