本文整理汇总了PHP中mosRedirect函数的典型用法代码示例。如果您正苦于以下问题:PHP mosRedirect函数的具体用法?PHP mosRedirect怎么用?PHP mosRedirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mosRedirect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sendNewPass
function sendNewPass($option)
{
global $database, $Itemid;
global $mosConfig_live_site, $mosConfig_sitename;
$_live_site = $mosConfig_live_site;
$_sitename = $mosConfig_sitename;
// ensure no malicous sql gets past
$checkusername = trim(mosGetParam($_POST, 'checkusername', ''));
$checkusername = $database->getEscaped($checkusername);
$confirmEmail = trim(mosGetParam($_POST, 'confirmEmail', ''));
$confirmEmail = $database->getEscaped($confirmEmail);
$database->setQuery("SELECT id FROM #__users" . "\nWHERE username='{$checkusername}' AND email='{$confirmEmail}'");
if (!($user_id = $database->loadResult()) || !$checkusername || !$confirmEmail) {
mosRedirect("index.php?option={$option}&task=lostPassword&mosmsg=" . _ERROR_PASS);
}
$database->setQuery("SELECT name, email FROM #__users" . "\n WHERE usertype='superadministrator'");
$rows = $database->loadObjectList();
foreach ($rows as $row) {
$adminName = $row->name;
$adminEmail = $row->email;
}
$newpass = mosMakePassword();
$message = _NEWPASS_MSG;
eval("\$message = \"{$message}\";");
$subject = _NEWPASS_SUB;
eval("\$subject = \"{$subject}\";");
mosMail($mosConfig_mailfrom, $mosConfig_fromname, $confirmEmail, $subject, $message);
$newpass = md5($newpass);
$sql = "UPDATE #__users SET password='{$newpass}' WHERE id='{$user_id}'";
$database->setQuery($sql);
if (!$database->query()) {
die("SQL error" . $database->stderr(true));
}
mosRedirect("index.php?Itemid={$Itemid}&mosmsg=" . _NEWPASS_SENT);
}
开发者ID:cwcw,项目名称:cms,代码行数:35,代码来源:registration.php
示例2: saveMenu
function saveMenu($option)
{
global $database;
$params = mosGetParam($_POST, 'params', '');
$params[url] = mosGetParam($_POST, 'url', '');
if (is_array($params)) {
$txt = array();
foreach ($params as $k => $v) {
$txt[] = "{$k}={$v}";
}
$_POST['params'] = implode("\n", $txt);
}
$row = new mosMenu($database);
if (!$row->bind($_POST)) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
if (!$row->check()) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
if (!$row->store()) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
$row->checkin();
$row->updateOrder("menutype='{$row->menutype}' AND parent='{$row->parent}'");
mosRedirect("index2.php?option={$option}&menutype={$row->menutype}");
}
开发者ID:cwcw,项目名称:cms,代码行数:29,代码来源:wrapper.class.php
示例3: sendMail
function sendMail()
{
global $database, $my, $acl, $adminLanguage;
global $mosConfig_sitename, $mosConfig_debug;
global $mosConfig_mailfrom, $mosConfig_fromname;
$n = 0;
$message_body = mosGetParam($_POST, 'mm_message', '');
$message_body = stripslashes($message_body);
$subject = mosGetParam($_POST, 'mm_subject', '');
$gou = mosGetParam($_POST, 'mm_group', NULL);
$recurse = mosGetParam($_POST, 'mm_recurse', 'NO_RECURSE');
if (!$message_body || !$subject || $gou === null) {
mosRedirect("index2.php?option=com_massmail&mosmsg=" . $adminLanguage->A_COMP_MASS_FILL);
}
// get users in the group out of the acl
$to = $acl->get_group_objects($gou, 'ARO', $recurse);
$rows = array();
if (count($to['users']) || $gou === '0') {
// Get sending email address
$database->setQuery("SELECT email FROM #__users WHERE id='{$my->id}'");
$my->email = $database->loadResult();
// Get all users email and group except for senders
$database->setQuery("SELECT email FROM #__users" . "\n WHERE id != '{$my->id}'" . ($gou !== '0' ? " AND id IN (" . implode(',', $to['users']) . ")" : ""));
$rows = $database->loadObjectList();
// Build e-mail message format
$message_header = sprintf(_MASSMAIL_MESSAGE, $mosConfig_sitename);
$message = $message_header . $message_body;
$subject = $mosConfig_sitename . ' / ' . stripslashes($subject);
//Send email
foreach ($rows as $row) {
mosMail($mosConfig_mailfrom, $mosConfig_fromname, $row->email, $subject, $message);
}
}
mosRedirect("index2.php", $adminLanguage->A_COMP_MASS_SENT . " " . count($rows) . " " . $adminLanguage->A_COMP_MASS_USERS);
}
开发者ID:cwcw,项目名称:cms,代码行数:35,代码来源:admin.massmail.php
示例4: pollAddVote
function pollAddVote($uid)
{
global $database, $mosConfig_offset, $Itemid;
/*
$params = new stdClass();
if ( $Itemid ) {
$component = new mosComponent( $database );
$component->load( $Itemid );
$params =& new mosParameters( $component->params );
$params->set( 'redirect', 1 );
$redirect = $params->get( 'redirect' );
}
*/
$redirect = 1;
$sessioncookie = mosGetParam($_REQUEST, 'sessioncookie', '');
if (!$sessioncookie) {
echo '<h3>' . _ALERT_ENABLED . '"</h3>';
echo '<input class="button" type="button" value="' . _CMN_CONTINUE . '" onClick="window.history.go(-1);">';
return;
}
$poll = new mosPoll($database);
if (!$poll->load($uid)) {
echo '<h3>' . _NOT_AUTH . '</h3>';
echo '<input class="button" type="button" value="' . _CMN_CONTINUE . '" onClick="window.history.go(-1);">';
return;
}
$cookiename = "voted{$poll->id}";
$voted = mosGetParam($_COOKIE, $cookiename, '0');
//if ($voted) {
// echo "<h3>"._ALREADY_VOTE."</h3>";
// echo "<input class=\"button\" type=\"button\" value=\""._CMN_CONTINUE."\" onClick=\"window.history.go(-1);\">";
// return;
//}
$voteid = mosGetParam($_POST, 'voteid', 0);
if (!$voteid) {
echo "<h3>" . _NO_SELECTION . "</h3>";
echo '<input class="button" type="button" value="' . _CMN_CONTINUE . '" onClick="window.history.go(-1);">';
return;
}
setcookie($cookiename, '1', time() + $poll->lag);
$database->setQuery("UPDATE #__poll_data SET hits=hits + 1" . "\n WHERE pollid='{$poll->id}' AND id='{$voteid}'");
$database->query();
$database->setQuery("UPDATE #__polls SET voters=voters + 1" . "\n WHERE id='{$poll->id}'");
$database->query();
$now = date("Y-m-d G:i:s");
$database->setQuery("INSERT INTO #__poll_date SET date='{$now}', vote_id='{$voteid}',\tpoll_id='{$poll->id}'");
$database->query();
if ($redirect) {
mosRedirect(sefRelToAbs('index.php?option=com_poll&task=results&id=' . $uid), _THANKS);
} else {
echo '<h3>' . _THANKS . '</h3>';
echo '<form action="" method="GET">';
echo '<input class="button" type="button" value="' . _BUTTON_RESULTS . '" onClick="window.location=\'' . sefRelToAbs('index.php?option=com_poll&task=results&id=' . $uid) . '\'">';
echo '</form>';
}
}
开发者ID:cwcw,项目名称:cms,代码行数:56,代码来源:poll.php
示例5: clearData
function clearData($cid = array())
{
DOCMAN_token::check() or die('Invalid Token');
$msgs = array();
$cleardata = new DOCMAN_Cleardata($cid);
$cleardata->clear();
$rows =& $cleardata->getList();
foreach ($rows as $row) {
$msgs[] = $row->msg;
}
mosRedirect('index2.php?option=com_docman§ion=cleardata', implode(' | ', $msgs));
}
开发者ID:RangerWalt,项目名称:ecci,代码行数:12,代码来源:cleardata.php
示例6: save
function save()
{
global $my, $mainframe, $database, $option, $priTask, $subTask;
global $WBG_CONFIG, $wbGalleryDB_cat, $wbGallery_admin;
// Check Writeable
if (!is_writable($wbGallery_admin . '/config.php')) {
echo "<script> alert('Permission Denied for config.php'); window.history.go(-1); </script>\n";
exit;
}
// Save Old Configuration
$bakFile = $wbGallery_admin . '/config_bak.' . date('Y-m-d') . '.php';
if (!file_exists($bakFile) && !copy($wbGallery_admin . '/config.php', $bakFile)) {
echo "<script> alert('Failed to Create Backup Copy of Configuration {$bakFile}'); window.history.go(-1); </script>\n";
exit;
}
// Process Configuration Values
$exLines = array();
$exLines[] = '<?php' . "\n";
$exLines[] = 'defined(\'_VALID_MOS\') or die(\'Restricted access\');' . "\n";
$exLines[] = '$WBG_CONFIG = new stdClass();';
$wbgConfig = mosGetParam($_REQUEST, 'wbgconf');
// Prepare Output & Count Active Types
$img_types = 0;
foreach ($wbgConfig as $k => $v) {
$exLines[] = '$WBG_CONFIG->' . $k . " = '" . addslashes($v) . "';";
if (preg_match('/^save_/', $k) && (int) $v) {
$img_types++;
}
}
// Write New Configuration
$fp = fopen($wbGallery_admin . '/config.php', 'w');
fwrite($fp, join("\n", $exLines));
fclose($fp);
// If No Types Active, Flag Error and Force Return...
if (!$img_types) {
$subTask = 'error';
$errorMsg = 'No Image Types where set to Active!\\nAt Least (1) Type is Required, or else nothing will be stored when you try and add images!';
}
// Redirect
switch ($subTask) {
case 'save':
mosRedirect('index2.php?option=' . $option, 'Configuration Saved Successfully');
break;
case 'error':
echo "<script> alert('Error: {$errorMsg}'); document.location='index2.php?option={$option}&task=setup'; </script>\n";
exit;
break;
default:
mosRedirect('index2.php?option=' . $option . '&task=setup', 'Configuration Saved Successfully');
break;
}
}
开发者ID:planetangel,项目名称:Planet-Angel-Website,代码行数:52,代码来源:setup.php
示例7: pollAddVote
function pollAddVote($uid)
{
global $database;
// simple spoof check security
josSpoofCheck(0, 'poll');
$redirect = 1;
$sessionCookieName = mosMainFrame::sessionCookieName();
$sessioncookie = mosGetParam($_REQUEST, $sessionCookieName, '');
if (!$sessioncookie) {
echo '<h3>' . _ALERT_ENABLED . '</h3>';
echo '<input class="button" type="button" value="' . _CMN_CONTINUE . '" onClick="window.history.go(-1);">';
return;
}
$poll = new mosPoll($database);
if (!$poll->load((int) $uid)) {
echo '<h3>' . _NOT_AUTH . '</h3>';
echo '<input class="button" type="button" value="' . _CMN_CONTINUE . '" onClick="window.history.go(-1);">';
return;
}
$cookiename = "voted{$poll->id}";
$voted = mosGetParam($_COOKIE, $cookiename, '0');
if ($voted) {
echo "<h3>" . _ALREADY_VOTE . "</h3>";
echo "<input class=\"button\" type=\"button\" value=\"" . _CMN_CONTINUE . "\" onClick=\"window.history.go(-1);\">";
return;
}
$voteid = intval(mosGetParam($_POST, 'voteid', 0));
if (!$voteid) {
echo "<h3>" . _NO_SELECTION . "</h3>";
echo '<input class="button" type="button" value="' . _CMN_CONTINUE . '" onClick="window.history.go(-1);">';
return;
}
setcookie($cookiename, '1', time() + $poll->lag);
$query = "UPDATE #__poll_data" . "\n SET hits = hits + 1" . "\n WHERE pollid = " . (int) $poll->id . "\n AND id = " . (int) $voteid;
$database->setQuery($query);
$database->query();
$query = "UPDATE #__polls" . "\n SET voters = voters + 1" . "\n WHERE id = " . (int) $poll->id;
$database->setQuery($query);
$database->query();
$now = _CURRENT_SERVER_TIME;
$query = "INSERT INTO #__poll_date" . "\n SET date = " . $database->Quote($now) . ", vote_id = " . (int) $voteid . ", poll_id = " . (int) $poll->id;
$database->setQuery($query);
$database->query();
if ($redirect) {
mosRedirect(sefRelToAbs('index.php?option=com_poll&task=results&id=' . $uid), _THANKS);
} else {
echo '<h3>' . _THANKS . '</h3>';
echo '<form action="" method="GET">';
echo '<input class="button" type="button" value="' . _BUTTON_RESULTS . '" onClick="window.location=\'' . sefRelToAbs('index.php?option=com_poll&task=results&id=' . $uid) . '\'">';
echo '</form>';
}
}
开发者ID:allenahner,项目名称:mizzou,代码行数:52,代码来源:poll.php
示例8: redirect
function redirect($link, $message = '')
{
global $mainframe;
if (compa::joom10()) {
if (!preg_match("/index2/", $link) and function_exists('sefRelToAbs') and $GLOBALS[ACA . 'use_sef']) {
$link = sefRelToAbs($link);
}
mosRedirect($link, $message);
exit;
} else {
$mainframe->redirect($link, $message);
exit;
}
}
开发者ID:reeleis,项目名称:ohiocitycycles,代码行数:14,代码来源:compa.php
示例9: orderModule
function orderModule($uid, $inc, $option, $client = 'admin')
{
global $database;
$row = new mosModule($database);
$row->load((int) $uid);
if ($client == 'admin') {
$where = "client_id = 1";
} else {
$where = "client_id = 0";
}
$row->move($inc, "position = " . $database->Quote($row->position) . " AND ( {$where} )");
mosCache::cleanCache('com_content');
$redirect = mosGetParam($_REQUEST, 'redirect', 'index2.php?option=' . $option . '&client=' . $client);
mosRedirect($redirect);
}
开发者ID:RangerWalt,项目名称:ecci,代码行数:15,代码来源:modules.php
示例10: rename_item
function rename_item($dir, $item)
{
// rename directory or file
if (($GLOBALS["permissions"] & 01) != 01) {
show_error($GLOBALS["error_msg"]["accessfunc"]);
}
if (isset($GLOBALS['__POST']["confirm"]) && $GLOBALS['__POST']["confirm"] == "true") {
$newitemname = $GLOBALS['__POST']["newitemname"];
$newitemname = trim(basename(stripslashes($newitemname)));
if ($newitemname == '') {
show_error($GLOBALS["error_msg"]["miscnoname"]);
}
if (!jx_isFTPMode()) {
$abs_old = get_abs_item($dir, $item);
$abs_new = get_abs_item($dir, $newitemname);
} else {
$abs_old = get_item_info($dir, $item);
$abs_new = get_item_info($dir, $newitemname);
}
if (@$GLOBALS['jx_File']->file_exists($abs_new)) {
show_error($newitemname . ": " . $GLOBALS["error_msg"]["itemdoesexist"]);
}
$perms_old = $GLOBALS['jx_File']->fileperms($abs_old);
$ok = $GLOBALS['jx_File']->rename(get_abs_item($dir, $item), get_abs_item($dir, $newitemname));
if (jx_isFTPMode()) {
$abs_new = get_item_info($dir, $newitemname);
}
$GLOBALS['jx_File']->chmod($abs_new, $perms_old);
if ($ok === false || PEAR::isError($ok)) {
show_error('Could not rename ' . $item . ' to ' . $newitemname);
}
$msg = sprintf($GLOBALS['messages']['success_rename_file'], $item, $newitemname);
mosRedirect(make_link("list", $dir, null), $msg);
}
show_header($GLOBALS['messages']['rename_file']);
// Form
echo '<br /><form method="post" action="';
echo make_link("rename", $dir, $item) . "\">\n";
echo "<input type=\"hidden\" name=\"confirm\" value=\"true\" />\n";
echo "<input type=\"hidden\" name=\"item\" value=\"" . stripslashes($GLOBALS['__GET']["item"]) . "\" />\n";
// Submit / Cancel
echo "<table>\n<tr><tr><td colspan=\"2\">\n";
echo "<label for=\"newitemname\">" . $GLOBALS["messages"]["newname"] . ":</label> <input name=\"newitemname\" id=\"newitemname\" type=\"text\" size=\"60\" value=\"" . stripslashes($_GET['item']) . "\" /><br /><br /><br /></td></tr>\n";
echo "<tr><tr><td>\n<input type=\"submit\" value=\"" . $GLOBALS["messages"]["btnchange"];
echo "\"></td>\n<td><input type=\"button\" value=\"" . $GLOBALS["messages"]["btncancel"];
echo "\" onclick=\"javascript:location='" . make_link("list", $dir, NULL) . "';\">\n</td></tr></form></table><br />\n";
}
开发者ID:Caojunkai,项目名称:arcticfox,代码行数:47,代码来源:fun_rename.php
示例11: pollAddVote
function pollAddVote($uid)
{
global $database, $mosConfig_offset, $Itemid;
$redirect = 1;
$sessionCookieName = md5('site' . $GLOBALS['mosConfig_live_site']);
$sessioncookie = mosGetParam($_REQUEST, $sessionCookieName, '');
if (!$sessioncookie) {
echo '<h3>' . T_('Cookies must be enabled!') . '"</h3>';
echo '<input class="button" type="button" value="' . T_('Continue') . '" onClick="window.history.go(-1);">';
return;
}
$poll = new mosPoll($database);
if (!$poll->load($uid)) {
echo '<h3>' . T_('You are not authorized to view this resource.') . '</h3>';
echo '<input class="button" type="button" value="' . T_('Continue') . '" onClick="window.history.go(-1);">';
return;
}
$cookiename = "voted{$poll->id}";
$voted = mosGetParam($_COOKIE, $cookiename, '0');
if ($voted) {
echo "<h3>" . T_('You already voted for this poll today!') . "</h3>";
echo "<input class=\"button\" type=\"button\" value=\"" . T_('Continue') . "\" onClick=\"window.history.go(-1);\">";
return;
}
$voteid = mosGetParam($_POST, 'voteid', 0);
if (!$voteid) {
echo "<h3>" . T_('No selection has been made, please try again') . "</h3>";
echo '<input class="button" type="button" value="' . T_('Continue') . '" onClick="window.history.go(-1);">';
return;
}
setcookie($cookiename, '1', time() + $poll->lag);
$database->setQuery("UPDATE #__poll_data SET hits=hits + 1" . "\n WHERE pollid='{$poll->id}' AND id='{$voteid}'");
$database->query();
$database->setQuery("UPDATE #__polls SET voters=voters + 1" . "\n WHERE id='{$poll->id}'");
$database->query();
$now = date("Y-m-d G:i:s");
$database->setQuery("INSERT INTO #__poll_date SET date='{$now}', vote_id='{$voteid}',\tpoll_id='{$poll->id}'");
$database->query();
if ($redirect) {
mosRedirect(sefRelToAbs('index.php?option=com_poll&task=results&id=' . $uid), T_('Thanks for your vote!'));
} else {
echo '<h3>' . T_('Thanks for your vote!') . '</h3>';
echo '<form action="" method="GET">';
echo '<input class="button" type="button" value="' . T_('Results') . '" onClick="window.location=\'' . sefRelToAbs('index.php?option=com_poll&task=results&id=' . $uid) . '\'">';
echo '</form>';
}
}
开发者ID:jwest00724,项目名称:mambo,代码行数:47,代码来源:poll.php
示例12: sendMail
function sendMail()
{
global $database, $my, $acl;
global $mosConfig_sitename;
global $mosConfig_mailfrom, $mosConfig_fromname;
$mode = mosGetParam($_POST, 'mm_mode', 0);
$subject = mosGetParam($_POST, 'mm_subject', '');
$gou = mosGetParam($_POST, 'mm_group', NULL);
$recurse = mosGetParam($_POST, 'mm_recurse', 'NO_RECURSE');
$inc_blocked = mosGetParam($_POST, 'inc_blocked', 0);
// pulls message inoformation either in text or html format
if ($mode) {
$message_body = $_POST['mm_message'];
} else {
// automatically removes html formatting
$message_body = mosGetParam($_POST, 'mm_message', '');
}
$message_body = stripslashes($message_body);
if (!$message_body || !$subject || $gou === null) {
$msg = T_('Please fill in the form correctly');
mosRedirect('index2.php?option=com_massmail&mosmsg=' . $msg);
}
// get users in the group out of the acl
$to = $acl->get_group_objects($gou, 'ARO', $recurse);
$rows = array();
if (count($to['users']) || $gou === '0') {
// Get sending email address
$query = "SELECT email FROM #__users WHERE id='{$my->id}'";
$database->setQuery($query);
$my->email = $database->loadResult();
// Get all users email and group except for senders
$query = "SELECT email FROM #__users" . "\n WHERE id != '{$my->id}'" . ($inc_blocked !== '0' ? " AND block = 0 " : '') . ($gou !== '0' ? " AND id IN (" . implode(',', $to['users']) . ")" : '');
$database->setQuery($query);
$rows = $database->loadObjectList();
// Build e-mail message format
$message_header = sprintf(T_("This is an email from '%s'\n\nMessage:\n"), $mosConfig_sitename);
$message = $message_header . $message_body;
$subject = $mosConfig_sitename . ' / ' . stripslashes($subject);
//Send email
foreach ($rows as $row) {
mosMail($mosConfig_mailfrom, $mosConfig_fromname, $row->email, $subject, $message, $mode);
}
}
$msg = sprintf(Tn_('E-mail sent to %d user.', 'E-mail sent to %d users.', count($rows)), count($rows));
mosRedirect('index2.php?option=com_massmail', $msg);
}
开发者ID:jwest00724,项目名称:mambo,代码行数:46,代码来源:admin.massmail.php
示例13: editgroups
/**
* edit categories
*/
function editgroups($cid)
{
global $option;
$db =& JFactory::getDBO();
$my = & JFactory::getUser();
$row = new hwdvids_group( $db );
$row->load( $cid );
// fail if checked out not by 'me'
if ($row->isCheckedOut( $my->id )) {
//BUMP needs change for multilanguage support
mosRedirect( 'index.php?option='.$option.'&task=categories', 'The categorie $row->catname is currently being edited by another administrator.' );
}
$db->SetQuery("SELECT * FROM #__hwdvidsgroups"
. "\nWHERE id = $cid");
$db->loadObject($row);
if ($cid) {
$row->checkout( $my->id );
} else {
$row->published = 1;
}
$query = "SELECT m.*, u.name, u.username"
. " FROM #__hwdvidsgroup_membership AS m"
. " LEFT JOIN #__users AS u ON u.id = m.memberid"
. " WHERE m.groupid = ".$row->id;
$db->SetQuery($query);
$groupMembers = $db->loadObjectList();
$query = "SELECT v.*, video.title"
. " FROM #__hwdvidsvideos AS video"
. " LEFT JOIN #__hwdvidsgroup_videos AS v ON v.videoid = video.id"
. " WHERE v.groupid = ".$row->id;
$db->SetQuery($query);
$groupVideos = $db->loadObjectList();
hwdvids_HTML::editgroups($row, $groupMembers, $groupVideos);
}
开发者ID:rkern21,项目名称:videoeditor,代码行数:48,代码来源:groups.php
示例14: removeLog
function removeLog($cid)
{
DOCMAN_token::check() or die('Invalid Token');
global $database, $_DMUSER;
$log = new mosDMLog($database);
$rows = $log->loadRows($cid);
// For log mambots
if ($log->remove($cid)) {
if ($rows) {
$logbot = new DOCMAN_mambot('onLogDelete');
$logbot->setParm('user', $_DMUSER);
$logbot->copyParm('process', 'delete log');
$logbot->setParm('rows', $rows);
$logbot->trigger();
// Delete the logs
}
mosRedirect("index2.php?option=com_docman§ion=logs");
}
}
开发者ID:RangerWalt,项目名称:ecci,代码行数:19,代码来源:logs.php
示例15: saveConfigSource
function saveConfigSource($option)
{
josSpoofCheck();
//$filecontent = mosGetParam( $_POST, 'filecontent', '', _MOS_ALLOWHTML );
$filecontent = isset($_POST['filecontent']) ? strval($_POST['filecontent']) : '';
$filecontent = get_magic_quotes_gpc() ? stripslashes($filecontent) : $filecontent;
// var_dump($filecontent);die;
if ($filecontent) {
$file = JPATH_SITE . '/components/com_joomla_lms/includes/config.inc.php';
$enable_write = mosGetParam($_POST, 'enable_write', 0);
$oldperms = fileperms($file);
if ($enable_write) {
@chmod($file, $oldperms | 0222);
}
clearstatcache();
if (is_writable($file) == false) {
mosRedirect('index.php?option=' . $option . '&task=dev_config', str_replace('{file}', $file, _JLMS_CFG_MSG_F_NOT_WRITABLE));
}
if ($fp = fopen($file, 'w')) {
fputs($fp, $filecontent, strlen($filecontent));
fclose($fp);
if ($enable_write) {
@chmod($file, $oldperms);
} else {
if (mosGetParam($_POST, 'disable_write', 0)) {
@chmod($file, $oldperms & 0777555);
}
}
// if
mosRedirect('index.php?option=' . $option . '&task=dev_config');
} else {
if ($enable_write) {
@chmod($file, $oldperms);
}
mosRedirect('index.php?option=' . $option . '&task=dev_config', _JLMS_CFG_MSG_F_FAILD_TO_OPEN);
}
} else {
mosRedirect('index.php?option=' . $option . '&task=dev_config', _JLMS_CFG_MSG_UNKNOWN_ERROR);
}
}
开发者ID:parkmi,项目名称:dolschool14,代码行数:40,代码来源:admin.dev_config.php
示例16: sendNewPass
function sendNewPass($option)
{
global $database, $Itemid;
global $mosConfig_live_site, $mosConfig_sitename, $mosConfig_fromname;
$_live_site = $mosConfig_live_site;
$_sitename = $mosConfig_sitename;
// ensure no malicous sql gets past
$checkusername = trim(mosGetParam($_POST, 'checkusername', ''));
$checkusername = $database->getEscaped($checkusername);
$confirmEmail = trim(mosGetParam($_POST, 'confirmEmail', ''));
$confirmEmail = $database->getEscaped($confirmEmail);
$database->setQuery("SELECT id FROM #__users" . "\nWHERE username='{$checkusername}' AND email='{$confirmEmail}'");
if (!($user_id = $database->loadResult()) || !$checkusername || !$confirmEmail) {
mosRedirect("index.php?option={$option}&task=lostPassword&mosmsg=" . T_('Sorry, no corresponding user was found. Please make sure you entered a valid username and a valid email address. Both are required.'));
}
$database->setQuery("SELECT name, email FROM #__users" . "\n WHERE usertype='super administrator'");
$rows = $database->loadObjectList();
foreach ($rows as $row) {
$adminName = $row->name;
$adminEmail = $row->email;
}
$rawpass = mosMakePassword();
$message = sprintf(T_("The user account %s has this email associated with it.\n\nA web user from %s has just requested that a new password be sent.\n\n\nYour New Password is: %s\n\n\nIf you didn't ask for this, don't worry. You are seeing this message, not them. \nIf this was an error just login with your new password and then change your password to what you would like it to be."), $checkusername, $mosConfig_live_site, $rawpass);
#eval ("\$message = \"$message\";");
$subject = sprintf(T_('%s :: New password for - %s'), $_sitename, $checkusername);
#eval ("\$subject = \"$subject\";");
mosMail($mosConfig_mailfrom, $mosConfig_fromname, $confirmEmail, $subject, $message);
$newpass = md5($rawpass);
$sql = "UPDATE #__users SET password='{$newpass}' WHERE id='{$user_id}'";
$database->setQuery($sql);
if (!$database->query()) {
die("SQL error" . $database->stderr(true));
}
$loginfo = new mosLoginDetails($checkusername, $rawpass);
$mambothandler =& mosMambotHandler::getInstance();
$mambothandler->loadBotGroup('authenticator');
$mambothandler->trigger('userChange', array($loginfo));
mosRedirect("index.php?Itemid={$Itemid}&mosmsg=" . T_('New User Password created and sent!'));
}
开发者ID:jwest00724,项目名称:mambo,代码行数:39,代码来源:registration.php
示例17: saveMenu
function saveMenu($option)
{
global $database;
$params = mosGetParam($_POST, 'params', '');
$secids = mosGetParam($_POST, 'secid', array());
$secid = implode(',', $secids);
$params[sectionid] = $secid;
if (is_array($params)) {
$txt = array();
foreach ($params as $k => $v) {
$txt[] = "{$k}={$v}";
}
$_POST['params'] = implode("\n", $txt);
}
$row = new mosMenu($database);
if (!$row->bind($_POST)) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
if (count($secids) == 1 && $secids[0] != "") {
$row->link = str_replace("id=0", "id=" . $secids[0], $row->link);
$row->componentid = $secids[0];
}
if (!$row->check()) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
if (!$row->store()) {
echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n";
exit;
}
$row->checkin();
$row->updateOrder("menutype='{$row->menutype}' AND parent='{$row->parent}'");
mosRedirect('index2.php?option=' . $option . '&menutype=' . $row->menutype);
}
开发者ID:cwcw,项目名称:cms,代码行数:35,代码来源:content_blog_section.class.php
示例18: restoreTrash
/**
* Restores items selected to normal - restores to an unpublished state
*/
function restoreTrash($cid, $option)
{
global $database;
josSpoofCheck();
$type = mosGetParam($_POST, 'type', array(0));
$total = count($cid);
// restores to an unpublished state
$state = 0;
$ordering = 9999;
if ($type == 'content') {
// query to restore content items
mosArrayToInts($cid);
$cids = 'id=' . implode(' OR id=', $cid);
$query = "UPDATE #__content" . "\n SET state = " . (int) $state . ", ordering = " . (int) $ordering . "\n WHERE ( {$cids} )";
$database->setQuery($query);
if (!$database->query()) {
echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
exit;
}
} else {
if ($type == 'menu') {
sort($cid);
foreach ($cid as $id) {
$check = 1;
$row = new mosMenu($database);
$row->load($id);
// check if menu item is a child item
if ($row->parent != 0) {
$query = "SELECT id" . "\n FROM #__menu" . "\n WHERE id = " . (int) $row->parent . "\n AND ( published = 0 OR published = 1 )";
$database->setQuery($query);
$check = $database->loadResult();
if (!$check) {
// if menu items parent is not found that are published/unpublished make it a root menu item
$query = "UPDATE #__menu" . "\n SET parent = 0, published = " . (int) $state . ", ordering = 9999" . "\n WHERE id = " . (int) $id;
}
}
if ($check) {
// query to restore menu items
$query = "UPDATE #__menu" . "\n SET published = " . (int) $state . ", ordering = 9999" . "\n WHERE id = " . (int) $id;
}
$database->setQuery($query);
if (!$database->query()) {
echo "<script> alert('" . $database->getErrorMsg() . "'); window.history.go(-1); </script>\n";
exit;
}
}
}
}
$msg = $total . " Iten(s) restaurados com sucesso!";
mosRedirect("index2.php?option={$option}&mosmsg=" . $msg . "");
}
开发者ID:patricmutwiri,项目名称:joomlaclube,代码行数:54,代码来源:admin.trash.php
示例19: defined
<?php
/**
* @version $Id: template.php,v 1.1 2004/10/13 08:16:15 dappa Exp $
* @package Mambo_4.5.1
* @copyright (C) 2000 - 2004 Miro International Pty Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* Mambo is Free Software
* @subpackage Installer
*/
/** ensure this file is being included by a parent file */
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
// ensure user has access to this function
if (!$acl->acl_check('administration', 'install', 'users', $my->usertype, $element . 's', 'all')) {
mosRedirect('index2.php', _NOT_AUTH);
}
$client = mosGetParam($_REQUEST, 'client', '');
$userfile = mosGetParam($_REQUEST, 'userfile', dirname(__FILE__));
$userfile = mosPathName($userfile);
HTML_installer::showInstallForm($adminLanguage->A_INSTALL_TEMPL_INSTALL . ($client == 'admin' ? $adminLanguage->A_INSTALL_TEMPL_ADMIN_TEMPL : $adminLanguage->A_INSTALL_TEMPL_SITE_TEMPL), $option, 'template', $client, $userfile, '<a href="index2.php?option=com_templates&client=' . $client . '">' . $adminLanguage->A_INSTALL_TEMPL_BACKTTO_TEMPL . '</a>');
?>
<table class="content">
<?php
writableCell('media');
writableCell('administrator/templates');
writableCell('templates');
writableCell('images/stories');
?>
</table>
开发者ID:cwcw,项目名称:cms,代码行数:29,代码来源:template.php
示例20: mosRedirect
//-->
</script>
<?php
}
if ($return && !(strpos($return, 'com_registration') || strpos($return, 'com_login'))) {
// checks for the presence of a return url
// and ensures that this url is not the registration or logout pages
mosRedirect($return);
} else {
mosRedirect($mosConfig_live_site . '/index.php');
}
} else {
if ($option == 'cookiecheck') {
// No cookie was set upon login. If it is set now, redirect to the given page. Otherwise, show error message.
if (isset($_COOKIE[mosMainFrame::sessionCookieName()])) {
mosRedirect($return);
} else {
mosErrorAlert(_ALERT_ENABLED);
}
}
}
}
// detect first visit
$mainframe->detect();
// set for overlib check
$mainframe->set('loadOverlib', false);
$gid = intval($my->gid);
// gets template for page
$cur_template = $mainframe->getTemplate();
/** temp fix - this feature is currently disabled */
/** @global A places to store information from processing of the component */
开发者ID:jwest00724,项目名称:Joomla-1.0,代码行数:31,代码来源:index.php
注:本文中的mosRedirect函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论