本文整理汇总了PHP中errorPage函数的典型用法代码示例。如果您正苦于以下问题:PHP errorPage函数的具体用法?PHP errorPage怎么用?PHP errorPage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了errorPage函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
/**
* In this function, most actions of the module are carried out and the page generation is started, distibuted and rendered.
* @return void
* @see solidbase/lib/Page#run()
*/
function run()
{
global $Templates, $USER, $CONFIG, $Controller, $DB;
if (!$this->may($USER, READ | EDIT)) {
errorPage('401');
return false;
}
/**
* User input types
*/
$_REQUEST->setType('order', 'numeric', true);
$_REQUEST->setType('expand', 'bool');
$_REQUEST->setType('del', 'numeric');
if ($_REQUEST['del']) {
if ($Controller->{$_REQUEST['del']} && $Controller->{$_REQUEST['del']}->delete()) {
Flash::create(__('Newsitem removed'), 'confirmation');
}
}
/**
* Here, the page request and permissions decide what should be shown to the user
*/
$this->setContent('header', __('News'));
$this->setContent('main', $this->mainView());
$Templates->admin->render();
}
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:30,代码来源:NewsAdmin.php
示例2: run
function run()
{
global $Templates, $DB, $Controller;
if (!$this->mayI(READ | EDIT)) {
errorPage('401');
return false;
}
$_REQUEST->setType('add', 'string');
$_REQUEST->setType('edit', 'numeric');
$_REQUEST->setType('del', 'numeric');
$_REQUEST->setType('module', 'string');
$_REQUEST->setType('type', 'string');
$_REQUEST->setType('size', 'string');
$_REQUEST->setType('content', 'string');
$_REQUEST->setType('row', 'numeric');
$_REQUEST->setType('place', 'numeric');
//FIXME: Tillsvidare: Id på sidan som editeras
$pID = 8;
if ($_REQUEST['add']) {
$newModule = $Controller->newObj('PageModule');
$newModule->addData($pID, $_REQUEST['add']);
} elseif ($_REQUEST['edit']) {
$module = $Controller->{$_REQUEST['edit']};
if ($_REQUEST['module']) {
$module->module = $_REQUEST['module'];
} elseif ($_REQUEST['size']) {
$module->size = $_REQUEST['size'];
} elseif ($_REQUEST['type']) {
$module->type = $_REQUEST['type'];
} elseif ($_REQUEST['row'] !== false && $_REQUEST['place'] !== false) {
$module->move($_REQUEST['row'], $_REQUEST['place']);
} elseif ($_REQUEST['content']) {
$module->content = $_REQUEST['content'];
}
} elseif ($_REQUEST['del']) {
$Controller->{$_REQUEST['del']}->delete();
}
/* Get numbers of rows on page*/
$rowNum = $DB->pagelayout->getCell(array('pid' => $pID), "MAX(ROW)");
$pagecontent = false;
/* Get modules from each row */
for ($row = 0; $row <= $rowNum; $row++) {
$moduleIDs = $DB->pagelayout->asList(array('pid' => $pID, 'row' => $row), 'id', false, false, 'place');
$rowContent = array();
foreach ($moduleIDs as $mID) {
$moduleObj = $Controller->{$mID};
$rowContent[] = $moduleObj;
}
$pagecontent[$row] = $rowContent;
}
JS::loadjQuery();
JS::lib('pagelayoutedit');
$this->header = __('Page Layout');
$this->setContent('main', '<h1>Page Layout</h1>' . $this->displayEditor($pagecontent));
$Templates->admin->render();
}
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:56,代码来源:PageLayoutEditor.php
示例3: run
function run()
{
global $Templates;
if (!$this->mayI(READ)) {
errorPage(401);
}
$this->saveChanges();
$this->schematicEditor();
$Templates->admin->render();
}
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:10,代码来源:Bookings.php
示例4: start
function start()
{
global $conn;
$servername = "173.194.81.188";
$user = "joshua";
$pass = "impact!!";
$dbname = "BikeShare";
$conn = new mysqli($servername, $user, $pass, $dbname);
if ($conn->connect_error) {
$usernameErr = "Connection failed: " . $conn->connect_error;
errorPage();
exit;
}
}
开发者ID:JoshuaJWeldon,项目名称:BikeShare,代码行数:14,代码来源:func.php
示例5: mapController
protected function mapController()
{
if ($this->match !== false) {
$target = $this->match['target'];
$params = $this->match['params'];
$name = $this->match['name'];
$this->middleware = isset($target['middleware']) ? str_replace('/', '', $target['middleware']) : (isset($params['middleware']) ? str_replace('/', '', ucfirst($params['middleware'] . 'Middleware')) : null);
$this->controller = isset($target['controller']) ? str_replace('/', '', $target['controller']) : (isset($params['controller']) ? str_replace('/', '', ucfirst($params['controller'])) . 'Controller' : null);
$this->action = isset($target['action']) ? str_replace('/', '', $target['action']) : (isset($params['action']) ? str_replace('/', '', $params['action']) : 'index');
} else {
errorPage();
}
return $this;
}
开发者ID:Arunkumarcs,项目名称:HuMvc,代码行数:14,代码来源:AltorouterCore.php
示例6: run
/**
* In this function, most actions of the module are carried out and the page generation is started, distibuted and rendered.
* @return void
* @see solidbase/lib/Page#run()
*/
function run()
{
global $Templates, $USER, $CONFIG, $Controller, $DB;
if (!$this->may($USER, READ | EDIT)) {
errorPage('401');
return false;
}
if ($this->saveChanges()) {
redirect(array('id' => $this->that->ID));
}
global $Templates;
$this->setContent('header', __('Editing') . ': <i>' . $this->that . '</i>');
$this->setContent('main', new Formsection(__('Members'), $this->memberTab()) . new Formsection('Edit', Form::quick(false, null, $this->editTab())));
$Templates->admin->render();
}
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:20,代码来源:GroupAdmin.php
示例7: run
/**
* Contains actions and page view handling
* @return void
* @see solidbase/lib/Page#run()
*/
function run()
{
global $Templates, $USER, $DB, $CONFIG;
/**
* User input types
*/
$_REQUEST->setType('conf', 'string', true);
if (!$this->may($USER, ANYTHING)) {
errorPage(401);
}
if ($this->may($USER, EDIT)) {
if ($_REQUEST['conf']) {
$r = $DB->config->get(null, null, null, 'section,property');
while ($c = Database::fetchAssoc($r)) {
$val = @$_REQUEST['conf'][$c['section']][$c['property']];
switch ($c['type']) {
case 'CSV':
$val = @explode(',', $val);
case 'password':
if ($c['type'] == 'password' && $val == '********') {
continue 2;
}
case 'select':
case 'set':
case 'text':
if ($val === false) {
continue;
}
$CONFIG->{$c['section']}->{$c['property']} = $val;
break;
case 'check':
$CONFIG->{$c['section']}->{$c['property']} = (int) isset($val);
break;
}
}
Log::write('Configuration changed', 2);
Flash::create(__('The configuration was updated'), 'confirmation');
}
}
$this->setContent('header', 'Edit configuration');
$this->setContent('main', $this->viewAll());
$Templates->admin->render();
}
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:48,代码来源:ConfigEditor.php
示例8: run
function run()
{
global $DB, $Templates;
if (!$this->mayI(READ)) {
errorPage(401);
}
$_REQUEST->setType('delsd', 'string');
$_REQUEST->setType('editsd', 'string');
$_POST->setType('sdname', 'string');
$_POST->setType('sdassoc', 'string');
if ($_POST['sdname']) {
if ($_REQUEST['editsd']) {
if ($DB->subdomains->update(array('subdomain' => $_POST['sdname'], 'assoc' => $_POST['sdassoc']), array('subdomain' => $_REQUEST['editsd']))) {
Flash::create(__('Subdomain updated'), 'confirmation');
} else {
Flash::create(__('Subdomain in use'), 'warning');
}
} else {
if ($DB->subdomains->insert(array('subdomain' => $_POST['sdname'], 'assoc' => $_POST['sdassoc']))) {
Flash::create(__('New subdomain inserted'), 'confirmation');
} else {
Flash::create(__('Subdomain in use'), 'warning');
}
}
} elseif ($_REQUEST['delsd'] && $this->mayI(EDIT)) {
$DB->subdomains->delete(array('subdomain' => $_REQUEST['delsd']));
}
$r = $DB->subdomains->get(false, false, false, 'subdomain');
$tablerows = array();
while (false !== ($subdomain = Database::fetchAssoc($r))) {
$tablerows[] = new Tablerow($subdomain['subdomain'], $subdomain['assoc'], icon('small/delete', __('Delete subdomain'), url(array('delsd' => $subdomain['subdomain']), 'id')) . icon('small/pencil', __('Edit subdomain'), url(array('editsd' => $subdomain['subdomain']), 'id')));
}
if ($_REQUEST['editsd']) {
$sd = $DB->subdomains->getRow(array('subdomain' => $_REQUEST['editsd']));
$form = new Form('editSubdomain');
} else {
$sd = false;
$form = new Form('newSubdomain');
}
$this->setContent('main', (!empty($tablerows) ? new Table(new Tableheader(__('Subdomain'), __('Associated with..'), __('Actions')), $tablerows) : '') . $form->set($_REQUEST['editsd'] ? new Hidden('editsd', $_REQUEST['editsd']) : null, new input(__('Subdomain'), 'sdname', @$sd['subdomain']), new input(__('Associate with'), 'sdassoc', @$sd['assoc'], false, __('ID or alias to associate with the subdomain'))));
$Templates->render();
}
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:42,代码来源:Subdomains.php
示例9: section_playerinfo
function section_playerinfo()
{
$editAny = isFuncAllowed('edit_any_players');
$se = new FormEdit();
$se->trimAll();
$se->stripAll();
if (!$se->checkRequired(array('id', 'link'))) {
return errorPage('missing argument');
}
echo '<BR>';
$query = "select P.id, P.callsign, P.status, P.comment, \n P.logo, T.name as teamname, T.id teamid, T.leader, r.name as level,\n C.flagname, C.name as countryname, C.numcode as country,\n P.state, S.abbrev as stateabbr, P.logobg,\n P.email, P.emailpub, P.aim, P.altnik1, P.altnik2,\n P.ircnik1, P.emailpub, P.utczone, P.zonename, P.icq, P.city,\n P.yim, P.msm, P.jabber, P.md5password, \n unix_timestamp(P.created) as created, \n unix_timestamp(P.last_login) as last_login,\n r.id as role_id\n from (l_player P, bzl_roles r )\n left join l_team T on P.team = T.id\n left join bzl_countries C on P.country = C.numcode\n left join bzl_states S on P.state = S.id\n where P.id = '{$se->id}'\n and r.id = P.role_id \n ";
$se->setDataRow(mysql_fetch_assoc(sqlQuery($query)));
if ($se->f_cancel_x) {
$se->link = "playerinfo";
}
if ($se->link == 'playeradmin') {
// present edit form
// security check ...
if ($se->id != $_SESSION['playerid'] && !$editAny) {
errorPage('You are not authorized to edit this profile.');
section_playerinfo_displayPlayer($se);
return;
}
if ($se->f_ok_x) {
section_playerinfo_validate($se);
if (!$se->isError()) {
section_playerinfo_doSubmit($se);
$se->setNextState(FESTATE_INITIAL);
$se->setDataRow(mysql_fetch_assoc(sqlQuery($query)));
section_playerinfo_displayPlayer($se);
return;
}
}
$se->setNextState(FESTATE_SUBMIT);
section_playerinfo_presentEditForm($se);
} else {
section_playerinfo_displayPlayer($se);
}
}
开发者ID:szakats,项目名称:bzflag_mirror,代码行数:39,代码来源:playerinfo.php
示例10: section_register
function section_register()
{
$se = new FormEdit();
$se->trimAll();
$se->stripAll();
// meno 2007/05/01 ....
if (PRIVATE_LEAGUE != 0) {
return errorPage('Nuh uh, no reg for you');
}
$headers = apache_request_headers();
$fromIP = $_SERVER['REMOTE_ADDR'];
$fd = fopen(PROXY_LOG, 'a');
fwrite($fd, "\n----------------------- " . date('r') . " --------------------\n");
fwrite($fd, "*** FROM IP: {$_SERVER['REMOTE_ADDR']}\n");
foreach ($headers as $n => $v) {
fwrite($fd, "{$n}: {$v}\n");
}
foreach ($headers as $header => $value) {
if (strncmp($fromIP, '172', 3) == 0 || strcasecmp($header, 'X-Forwarded-For') == 0 || strcasecmp($header, 'Via') == 0) {
fwrite($fd, "************************* PROXY DETECT ***********************\n");
fclose($fd);
return errorPage("We're sorry, currently we cannot accept new registrations from AOL users, or users connecting through a proxy.");
}
}
fclose($fd);
if ($_SESSION['callsign']) {
return errorPage('You are already registered with the league system.');
}
if ($se->SUB) {
section_register_validate($se);
if (!$se->isError()) {
section_register_doSubmit($se);
return;
}
}
section_register_presentEditForm($se);
}
开发者ID:szakats,项目名称:bzflag_mirror,代码行数:37,代码来源:register.php
示例11: verbose
}
verbose("convolve = " . print_r($convolve, 1));
$upscale = getDefined(array('no-upscale', 'nu'), false, true);
verbose("upscale = {$upscale}");
$postProcessing = getConfig('postprocessing', array('png_filter' => false, 'png_filter_cmd' => '/usr/local/bin/optipng -q', 'png_deflate' => false, 'png_deflate_cmd' => '/usr/local/bin/pngout -q', 'jpeg_optimize' => false, 'jpeg_optimize_cmd' => '/usr/local/bin/jpegtran -copy none -optimize'));
$alias = get('alias', null);
$aliasPath = getConfig('alias_path', null);
$validAliasname = getConfig('valid_aliasname', '#^[a-z0-9A-Z-_]+$#');
$aliasTarget = null;
if ($alias && $aliasPath && $passwordMatch) {
$aliasTarget = $aliasPath . $alias;
$useCache = false;
is_writable($aliasPath) or errorPage("Directory for alias is not writable.", 403);
preg_match($validAliasname, $alias) or errorPage('Filename for alias contains invalid characters. Do not add extension.', 404);
} elseif ($alias) {
errorPage('Alias is not enabled in the config file or password not matching.', 403);
}
verbose("alias = {$alias}");
$cachePath = getConfig('cache_path', __DIR__ . '/../cache/');
$cacheControl = getConfig('cache_control', null);
if ($cacheControl) {
verbose("cacheControl = {$cacheControl}");
$img->addHTTPHeader("Cache-Control", $cacheControl);
}
$dummyDir = getConfig('dummy_dir', $cachePath . "/" . $dummyFilename);
if ($dummyImage === true) {
is_writable($dummyDir) or verbose("dummy dir not writable = {$dummyDir}");
$img->setSaveFolder($dummyDir)->setSource($dummyFilename, $dummyDir)->setOptions(array('newWidth' => $newWidth, 'newHeight' => $newHeight, 'bgColor' => $bgColor))->setJpegQuality($quality)->setPngCompression($compress)->createDummyImage()->generateFilename(null, false)->save(null, null, false);
$srcImage = $img->getTarget();
$imagePath = null;
verbose("src (updated) = {$srcImage}");
开发者ID:sonyarianto,项目名称:cimage,代码行数:31,代码来源:imgs.php
示例12: cs_sql_select
$from = 'threads thr INNER JOIN {pre}_board frm ON thr.board_id = frm.board_id ';
$from .= 'INNER JOIN {pre}_users usr ON thr.users_id = usr.users_id ';
$from .= 'INNER JOIN {pre}_categories cat ON frm.categories_id = cat.categories_id';
$select = 'thr.threads_headline AS threads_headline, frm.board_name AS board_name, cat.categories_name AS categories_name, thr.threads_id AS threads_id, frm.board_id AS board_id, frm.board_threads AS board_threads, cat.categories_id AS categories_id, frm.board_access AS board_access, thr.threads_important AS threads_important, thr.threads_close AS threads_close, thr.threads_time AS threads_time, thr.threads_last_time AS threads_last_time, usr.users_nick AS users_nick, usr.users_id AS users_id';
$where = 'threads_id = ' . (int) $thread_id;
$thread_edit = cs_sql_select(__FILE__, $from, $select, $where);
$thread_mods = cs_sql_select(__FILE__, 'boardmods', 'boardmods_modpanel', "users_id = '" . $account['users_id'] . "'", 0, 0, 1);
$thread_headline = $thread_edit['threads_headline'];
$board_id = $thread_edit['board_id'];
require_once 'mods/board/functions.php';
//Sicherheitsabfrage
if ($account['access_board'] < $thread_edit['board_access']) {
return errorPage('modpanel_q', $cs_lang);
}
if ($account['access_board'] < 5 and empty($thread_mods['boardmods_modpanel'])) {
return errorPage('modpanel_q', $cs_lang);
}
//Sicherheitsabfarge Ende
//Daten Abfragen
if (isset($_POST['close'])) {
$thread_cells = array('threads_close');
$thread_save = array($account['users_id']);
$action_lang = $cs_lang['action_close'];
} elseif (!empty($_POST['open'])) {
$thread_cells = array('threads_close');
$thread_save = array(0);
$action_lang = $cs_lang['action_open'];
} elseif (!empty($_POST['addpin'])) {
$thread_cells = array('threads_important');
$thread_save = array(1);
$action_lang = $cs_lang['action_addpin'];
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:modpanel_q.php
示例13: errorPage
return errorPage('thread_remove', $cs_lang);
}
if ($account['access_board'] >= $cs_thread['board_access']) {
$where_com = "comments_mod = 'board' AND comments_fid = " . (int) $thread_id;
$sum = cs_sql_count(__FILE__, 'comments', $where_com);
if ($account['access_comments'] >= 5 or !empty($thread_mods['boardmods_del'])) {
$allowed = 1;
} elseif ($cs_thread['users_id'] == $account['users_id'] and empty($sum)) {
$allowed = 1;
} else {
return errorPage('thread_remove', $cs_lang);
}
} elseif (!empty($check_sq)) {
$allowed = 1;
} elseif (empty($allowed) or empty($check_pw)) {
return errorPage('thread_remove', $cs_lang);
}
//Sicherheitsabfrage Ende
if (isset($_POST['agree'])) {
for ($run = 0; $run < $cs_boardfiles_loop; $run++) {
$file = $cs_boardfiles[$run]['boardfiles_name'];
$extension = strlen(strrchr($file, "."));
$name = strlen($file);
$ext = substr($file, $name - $extension + 1, $name);
//$file = cs_secure($cs_boardfiles[$run]['boardfiles_name']);
//echo 'uploads/board/files/' . $cs_boardfiles[$run]['boardfiles_id'] . '.' . $ext . cs_html_br(1);
cs_unlink('board', $cs_boardfiles[$run]['boardfiles_id'] . '.' . $ext, 'files');
}
cs_sql_delete(__FILE__, 'threads', $thread_id);
$query = "DELETE FROM {pre}_comments WHERE comments_mod='board' AND ";
$query .= "comments_fid=" . (int) $thread_id;
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:thread_remove.php
示例14: cs_sql_select
$where = "thr.threads_id = '" . $tid . "'";
$cs_thread = cs_sql_select(__FILE__, $from, $select, $where, 0, 0, 1);
//Sicherheitsabfrage Beginn
if (!empty($cs_thread['board_pwd'])) {
$where = 'users_id = ' . (int) $account['users_id'] . ' AND board_id = ' . (int) $cs_thread['board_id'];
$check_pw = cs_sql_count(__FILE__, 'boardpws', $where);
}
if (!empty($cs_thread['squads_id']) and $account['access_board'] < $cs_thread['board_access']) {
$sq_where = "users_id = " . (int) $account['users_id'] . " AND squads_id = " . (int) $cs_thread['squads_id'];
$check_sq = cs_sql_count(__FILE__, 'members', $sq_where);
}
if (empty($tid) || count($cs_thread) == 0) {
return errorPage('report', $cs_lang);
}
if ($account['access_board'] < $cs_thread['board_access'] and empty($check_sq) or empty($check_pw)) {
return errorPage('report', $cs_lang);
}
$report = isset($_POST['report']) ? $_POST['report'] : '';
if (isset($_POST['submit'])) {
$error = 0;
$errormsg = '';
if (empty($report)) {
$error++;
$errormsg .= $cs_lang['no_text'] . cs_html_br(1);
}
$exists = cs_sql_count(__FILE__, 'boardreport', "threads_id = " . (int) $tid . " AND comments_id = " . (int) $cid);
if (!empty($exists)) {
$error++;
$errormsg .= $cs_lang['report_exists'] . cs_html_br(1);
}
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:report.php
示例15: clockonandoff
function clockonandoff() {
include("table_names.inc");
//import global vars
global $contextUser, $year, $month, $day, $task_id, $proj_id, $Location;
global $destination, $clock_on_time_hour, $clock_off_time_hour,
$clock_on_time_min, $clock_off_time_min, $clockonoff;
global $log_message, $log_message_presented;
global $clock_on_radio, $clock_off_radio, $fromPopupWindow;
if ($clock_on_radio == "now" && $clock_off_radio == "now")
errorPage("You cannot clock on and off at with the same clock-on and clock-off time.", $fromPopupWindow);
//get the dates
if ($clock_on_radio == "now") {
$clock_on_time_hour = date("H");
$clock_on_time_min = date("i");
}
if ($clock_off_radio == "now") {
$clock_off_time_hour = date("H");
$clock_off_time_min = date("i");
}
//make sure we're not clocking on after clocking off
if (($clock_on_time_hour == $clock_off_time_hour) && ($clock_on_time_min > $clock_off_time_min))
errorPage("You cannot have your clock on time ($clock_on_time_hour:$clock_on_time_min) ".
"later than your clock off time ($clock_off_time_hour:$clock_off_time_min)", $fromPopupWindow);
else if ($clock_on_time_hour > $clock_off_time_hour)
errorPage("You cannot have your clock on time ($clock_on_time_hour:$clock_on_time_min) ".
"later than your clock off time ($clock_off_time_hour:$clock_off_time_min)", $fromPopupWindow);
else if (($clock_on_time_hour == $clock_off_time_hour) && ($clock_on_time_min == $clock_off_time_min))
errorPage("You cannot clock on and off with the same clock on and clock off time. on_hour=$clock_on_time_hour on_min=$clock_on_time_min off_hour=$clock_off_time_hour off_min=$clock_off_time_min", $fromPopupWindow);
if ($log_message_presented == false)
getLogMessage();
$log_message = addslashes($log_message);
$queryString = "INSERT INTO $TIMES_TABLE (uid, start_time, end_time, proj_id, task_id, log_message) ".
"VALUES ('$contextUser','$year-$month-$day $clock_on_time_hour:$clock_on_time_min:00', ".
"'$year-$month-$day $clock_off_time_hour:$clock_off_time_min:00', ".
"$proj_id, $task_id, '$log_message')";
list($qh,$num) = dbQuery($queryString);
Header("Location: $Location");
exit;
}
开发者ID:neilrjones,项目名称:timesheetphp,代码行数:46,代码来源:action.php
示例16: cs_sql_select
//Sicherheitsabfrage Beginn
$thread_mods = cs_sql_select(__FILE__, 'boardmods', 'boardmods_del', "users_id = '" . $account['users_id'] . "'", 0, 0, 1);
$allowed = 0;
if (empty($comments_id) || count($cs_comments) == 0) {
return errorPage('com_remove', $cs_lang);
}
if ($account['access_board'] >= $cs_thread['board_access']) {
$allowed = 0;
if ($account['access_comments'] >= 5 or !empty($thread_mods['boardmods_del'])) {
$allowed = 1;
} else {
return errorPage('com_remove', $cs_lang);
}
} else {
if (empty($allowed)) {
return errorPage('com_remove', $cs_lang);
}
}
//Sicherheitsabfrage Ende
if (isset($_POST['agree'])) {
for ($run = 0; $run < $cs_com_files_loop; $run++) {
$file = $cs_com_files[$run]['boardfiles_name'];
$extension = strlen(strrchr($file, "."));
$name = strlen($file);
$ext = substr($file, $name - $extension + 1, $name);
//$file = cs_secure($cs_boardfiles[$run]['boardfiles_name']);
//echo 'uploads/board/files/' . $cs_com_files[$run]['boardfiles_id'] . '.' . $ext . cs_html_br(1);
cs_unlink('board', $cs_com_files[$run]['boardfiles_id'] . '.' . $ext, 'files');
$query = "DELETE FROM {pre}_boardfiles WHERE boardfiles_id = '" . $cs_com_files[$run]['boardfiles_id'] . "'";
cs_sql_query(__FILE__, $query);
}
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:com_remove.php
示例17: Header
require "class.CommandMenu.php";
if (!$authenticationManager->isLoggedIn()) {
Header("Location: login.php?redirect={$_SERVER['PHP_SELF']}");
exit;
}
// Connect to database.
$dbh = dbConnect();
$contextUser = strtolower($_SESSION['contextUser']);
$loggedInUser = strtolower($_SESSION['loggedInUser']);
$passwd1 = "";
$passwd2 = "";
$old_pass = "";
//load local vars from superglobals
if (isset($_POST["action"])) {
if (!isset($_POST["passwd1"]) || !isset($_POST["passwd2"]) || !isset($_POST["old_pass"])) {
errorPage("Please fill out all fields.");
}
$passwd1 = $_POST['passwd1'];
$passwd2 = $_POST['passwd2'];
$old_pass = $_POST['old_pass'];
}
//get todays values
$today = time();
$today_year = date("Y", $today);
$today_month = date("n", $today);
$today_day = date("j", $today);
//define the command menu
include "timesheet_menu.inc";
//check for guest user
if ($loggedInUser == 'guest') {
$errormsg = "Guest may not change password.";
开发者ID:neilrjones,项目名称:timesheetphp,代码行数:31,代码来源:changepwd.php
示例18: run
/**
* Execute action when called for explicitly by the user
*
* This function also contains the actions available in the interface provided, including file
* uploading, compressed file extraction and the creation of folders.
* @return void
*/
function run()
{
global $Templates, $USER, $Controller, $ID, $CONFIG;
/**
* User input types
*/
$_REQUEST->setType('action', 'string');
$_REQUEST->setType('popup', 'string');
$_REQUEST->setType('filter', 'string');
if (!$this->may($USER, READ)) {
errorPage(401);
} else {
if (!in_array($CMPRExtension = $CONFIG->files->compression_format, array('tar', 'gz', 'tgz', 'tbz', 'zip', 'ar', 'deb'))) {
$CONFIG->files->compression_format = $CMPRExtension = 'zip';
}
$render = true;
switch ($_REQUEST['action']) {
// All users
case 'download':
global $PREVENT_CSIZE_HEADER;
$PREVENT_CSIZE_HEADER = true;
while (ob_get_level()) {
echo ob_get_clean();
}
require_once "File/Archive.php";
File_Archive::extract($this->path, File_Archive::toArchive($this->filename . '.' . $CMPRExtension, File_Archive::toOutput()));
die;
default:
$this->setContent("main", $this->genHTML());
break;
}
if ($render) {
$t = 'admin';
if ($_REQUEST['popup']) {
$t = 'popup';
}
$Templates->{$t}->render();
}
}
}
开发者ID:jonatanolofsson,项目名称:solidba.se,代码行数:47,代码来源:Folder.php
示例19: signin
function signin()
{
// user already logged in
if (isLogged()) {
header('Location: ' . Path::admin());
exit;
}
global $tpl;
global $_CONFIG;
if (!canLogin()) {
global $tpl;
$tpl->assign('page_title', 'Error');
$tpl->assign('menu_links', Path::menu('error'));
$tpl->assign('error_title', 'You’re in jail');
$tpl->assign('error_content', 'You have been banned after too many bad attemps. <div class="espace-top">Please try later.</div>');
$tpl->draw('error');
exit;
}
if (!empty($_POST['login']) && !empty($_POST['password'])) {
if (!empty($_POST['token']) && acceptToken($_POST['token'])) {
if (check_auth(htmlspecialchars($_POST['login']), $_POST['password'])) {
loginSucceeded();
$cookiedir = '';
if (dirname($_SERVER['SCRIPT_NAME']) != '/') {
$cookiedir = dirname($_SERVER["SCRIPT_NAME"]) . '/';
}
session_set_cookie_params(0, $cookiedir, $_SERVER['HTTP_HOST']);
session_regenerate_id(TRUE);
// check if we need to redirect the user
$target = isset($_GET['target']) && targetIsAllowed($_GET['target']) ? Path::$_GET['target']() : './';
header('Location: ' . $target);
exit;
}
loginFailed();
errorPage('The given username or password was wrong. <br />If you do not remberer your login informations, just delete the file <code>' . basename($_CONFIG['settings']) . '</code>.', 'Invalid username or password');
}
loginFailed();
errorPage('The received token was empty or invalid.', 'Invalid security token');
}
$tpl->assign('page_title', 'Sign in');
$tpl->assign('menu_links', Path::menu('signin'));
$tpl->assign('target', isset($_GET['target']) && targetIsAllowed($_GET['target']) ? htmlspecialchars($_GET['target']) : NULL);
$tpl->assign('token', getToken());
$tpl->draw('form.signin');
exit;
}
开发者ID:Devenet,项目名称:MyBooks,代码行数:46,代码来源:index.php
示例20: cs_sql_count
$sq_where = "users_id = " . (int) $account['users_id'] . " AND squads_id = " . (int) $cs_thread['squads_id'];
$check_sq = cs_sql_count(__FILE__, 'members', $sq_where);
}
if (empty($fid) || count($cs_thread) == 0) {
return errorPage('com_edit', $cs_lang);
}
if ($account['access_board'] >= $cs_thread['board_access'] or !empty($check_sq)) {
$allowed = 0;
if (($cs_thread['users_id'] == $account['users_id'] or $account['access_comments'] >= 4 or !empty($thread_mods['boardmods_edit'])) and !empty($check_pw)) {
$allowed = 1;
} else {
return errorPage('com_edit', $cs_lang);
}
} else {
if (empty($allowed)) {
return errorPage('com_edit', $cs_lang);
}
}
//Sicherheitsabfrage Ende
// Boardfiles Berechnung Start
$run_loop_files = '0';
$check = cs_sql_count(__FILE__, 'boardfiles', 'threads_id =' . $cs_thread['threads_id'] . ' AND comments_id=' . $comments_id);
if (!empty($check) and empty($_POST)) {
$from = 'boardfiles';
$select = 'boardfiles_id, threads_id, users_id, boardfiles_name';
$where = 'threads_id=' . $cs_thread['threads_id'] . ' AND comments_id=' . $comments_id;
$cs_boardfiles = cs_sql_select(__FILE__, $from, $select, $where, '', '', '');
$run_loop_files = count($cs_boardfiles);
$files = '1';
} else {
$files = isset($_POST['files']) ? $_POST['files'] : 0;
开发者ID:aberrios,项目名称:WEBTHESGO,代码行数:31,代码来源:com_edit.php
注:本文中的errorPage函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论