本文整理汇总了PHP中escapeString函数的典型用法代码示例。如果您正苦于以下问题:PHP escapeString函数的具体用法?PHP escapeString怎么用?PHP escapeString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了escapeString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* @see lib/modules/CommandModule::execute()
*/
public function execute($user, $target, $message)
{
// split message
$messageEx = explode(' ', $message);
if ($target[0] != '#') {
$target = $messageEx[1];
unset($messageEx[1]);
$messageEx = array_values($messageEx);
}
if (!$this->bot->isRegistered($target)) {
return $this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.notRegistered'));
}
$access = $this->bot->getAccess($target, Services::getUserManager()->getUser($user->getUuid())->accountname);
if ($access < 500) {
return $this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.permissionDenied'));
}
$sql = "SELECT\n\t\t\t\tunregistercode\n\t\t\tFROM\n\t\t\t\tchanserv_channels\n\t\t\tWHERE\n\t\t\t\tchannel = '" . escapeString($target) . "'";
$row = Services::getDB()->getFirstRow($sql);
$code = $row['unregistercode'];
if (isset($messageEx[1])) {
if ($code != trim($messageEx[1])) {
return $this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.codeWrong', $target));
}
// TODO: Validate unregistercode
$this->bot->unregister($target);
$this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.success', $target));
} else {
$this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.code', $code));
}
}
开发者ID:Evil-Co-Legacy,项目名称:Evil-Co.de-Services,代码行数:33,代码来源:CommandCunregister.class.php
示例2: updateDatabase
public function updateDatabase($debug = false)
{
$keys = array();
$values = array();
$query = '';
if ($this->ID == null) {
foreach ($this->_Params as $key => $propertie) {
if ($this->{$propertie} != null) {
$keys[] = '`' . $key . '`';
$values[] = "'" . escapeString($this->{$propertie}) . "'";
}
}
$query = "INSERT INTO `" . $this->getDBName() . "` (" . implode(', ', $keys) . ") VALUES (" . implode(', ', $values) . ")";
Framework::getDb()->query($query);
if (($lastID = Framework::getDb()->getLastID()) != 0) {
$this->ID = $lastID;
}
} else {
foreach ($this->_Params as $key => $propertie) {
if ($key != 'id') {
$values[] = "`" . $key . "` = '" . escapeString($this->{$propertie}) . "'";
}
}
$query = "UPDATE `" . $this->getDBName() . "` SET " . implode(', ', $values) . " WHERE `id` = '" . escapeString($this->ID) . "'";
if ($debug == true) {
echo '<pre>';
//print_r($this);
echo '<strong>Query</strong>: ' . $query . '<br />';
echo '</pre>';
}
Framework::getDb()->query($query);
}
return true;
}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:34,代码来源:DatabaseObject.class.php
示例3: update
/**
* Updates the data in our database table
*/
public function update()
{
$updateSQL = '';
$updateSQL .= '`authorID` = ' . $this->authorID;
if (!empty($this->authorName)) {
if (!empty($updateSQL)) {
$updateSQL .= ',';
}
$updateSQL .= '`authorName` = \'' . escapeString($this->authorName) . '\'';
}
if (!empty($updateSQL)) {
$updateSQL .= ',';
}
$updateSQL .= '`serverID` = ' . $this->serverID . '';
if (!empty($this->serverName)) {
if (!empty($updateSQL)) {
$updateSQL .= ',';
}
$updateSQL .= '`serverName` = \'' . escapeString($this->serverID) . '\'';
}
if (!empty($this->text)) {
if (!empty($updateSQL)) {
$updateSQL .= ',';
}
$updateSQL .= '`text` = \'' . escapeString($this->text) . '\'';
}
$updateSQL .= ',`votes` = ' . $this->votes;
$updateSQL .= ',`isDisabled` = ' . $this->isDisabled;
$updateSQL .= ",`enableSmilies` = " . ($this->enableSmilies ? 1 : 0);
$updateSQL .= ",`enableHTML` = " . ($this->enableHTML ? 1 : 0);
$updateSQL .= ",`enableBBCodes` = " . ($this->enableBBCodes ? 1 : 0);
$sql = "UPDATE bash" . BASH_N . "_entry\r\n\t\t\t\tSET\r\n\t\t\t\t\t" . $updateSQL . "\r\n\t\t\t\tWHERE\r\n\t\t\t\t\tentryID = " . $this->entryID;
WCF::getDB()->sendQuery($sql);
}
开发者ID:Evil-Co-Legacy,项目名称:Bash-Database,代码行数:37,代码来源:BashEntryEditor.class.php
示例4: update
/**
* Updates the data in our database table
*/
public function update()
{
$updateSQL = '';
if (!empty($this->serverID)) {
if (!empty($updateSQL)) {
$updateSQL .= ',';
}
$updateSQL .= '`serverID` = ' . $this->serverID;
}
if (!empty($updateSQL)) {
$updateSQL .= ',';
}
$updateSQL .= '`authorID` = ' . $this->authorID;
if (!empty($this->authorName)) {
if (!empty($updateSQL)) {
$updateSQL .= ',';
}
$updateSQL .= '`authorName` = \'' . escapeString($this->authorName) . '\'';
}
$updateSQL .= ',`message` = \'' . escapeString($this->message) . '\'';
$updateSQL .= ",`timestamp` = " . $this->timestamp;
$updateSQL .= ',`enableSmilies` = ' . ($this->enableSmilies ? '1' : '0');
$updateSQL .= ',`enableHtml` = ' . ($this->enableHtml ? '1' : '0');
$updateSQL .= ',`enableBBCodes` = ' . ($this->enableBBCodes ? '1' : '0');
$updateSQL .= ",`isDisabled` = " . $this->isDisabled;
$sql = "UPDATE bash" . BASH_N . "_server_comment\r\n\t\t\t\tSET\r\n\t\t\t\t\t" . $updateSQL . "\r\n\t\t\t\tWHERE\r\n\t\t\t\t\tcommentID = " . $this->commentID;
WCF::getDB()->sendQuery($sql);
}
开发者ID:Evil-Co-Legacy,项目名称:Bash-Database,代码行数:31,代码来源:ServerCommentEditor.class.php
示例5: __construct
/**
* @see WCF::__construct()
*/
public function __construct()
{
// include options before locking
try {
$this->initOptions();
} catch (Exception $e) {
// ignore ...
}
// check locking
$userID = @intval($_COOKIE[COOKIE_PREFIX . 'userID']);
if ($userID) {
$i = 0;
do {
try {
LWUtil::checkLock($userID);
// everything okay
break;
} catch (SystemException $e) {
if ($i >= 6) {
die($e->getMessage());
}
++$i;
usleep(500000);
}
} while (true);
}
// bugfix
if (WCF::getDB() !== null) {
return false;
}
parent::__construct();
// game-frontend only
if ($this->getUser()->userID == 0) {
return;
}
$args = array_merge($_GET, $_POST);
if (isset($args['password'])) {
unset($args['password']);
}
// log request
$sql = "INSERT INTO ugml_request\r\n\t\t\t\t(userID, `time`, ip,\r\n\t\t\t\t data)\r\n\t\t\t\tVALUES\r\n\t\t\t\t(" . $this->getUser()->userID . ", " . TIME_NOW . ", INET_ATON('" . $_SERVER['REMOTE_ADDR'] . "'),\r\n\t\t\t\t '" . escapeString(SerializeUtil::serialize(array('page' => LWUtil::getFileName(), 'args' => $args))) . "')";
WCF::getDB()->sendQuery($sql);
self::$requestID = WCF::getDB()->getInsertID();
if ($this->getUser()->lastLoginTime < TIME_NOW - 60 * 60 * 12 && $this->getUser()->lastLoginTime > 1188597600 && !defined('LOGIN')) {
self::logout('index.htm');
}
if ($this->getUser()) {
if ($this->getUser()->urlaubs_modus == 2) {
$sql = "UPDATE ugml_users\r\n\t\t\t\t\t\tSET urlaubs_modus = 0\r\n\t\t\t\t\t\tWHERE id = " . $this->getUser()->userID;
WCF::getDB()->sendQuery($sql);
Session::resetSessions($this->getUser()->userID);
$this->getUser()->urlaubs_modus = 0;
}
}
$this->initPlanet();
// detect bots
/*require_once(LW_DIR.'lib/data/protection/BotDetector.class.php');
new BotDetector();*/
$this->initSpec();
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:63,代码来源:LWCore.class.php
示例6: __construct
/**
* Reads a host row from database
* @param integer $hostID
* @param array $row
* @param string $host
*/
public function __construct($hostID, $row = null, $host = null, $languageCode = null)
{
$this->sqlSelects .= 'host.*';
// create sql conditions
$sqlCondition = '';
if ($hostID !== null) {
$sqlCondition .= "host.hostID = " . $hostID;
}
if ($host !== null) {
if (!empty($sqlCondition)) {
$sqlCondition .= " AND ";
}
$sqlCondition .= "host.hostname = '" . escapeString($host) . "'";
}
if ($languageCode !== null) {
if (!empty($sqlCondition)) {
$sqlCondition .= " AND ";
}
$sqlCondition .= "host.languageCode = '" . escapeString($languageCode) . "'";
}
// execute sql statement
if (!empty($sqlCondition)) {
$sql = "SELECT \t" . $this->sqlSelects . "\r\n\t\t\t\tFROM \twcf" . WCF_N . "_host host\r\n\t\t\t\t\t" . $this->sqlJoins . "\r\n\t\t\t\tWHERE \t" . $sqlCondition . $this->sqlGroupBy;
$row = WCF::getDB()->getFirstRow($sql);
}
// handle result set
parent::__construct($row);
}
开发者ID:Evil-Co-Legacy,项目名称:Evil-Co.de-CMS,代码行数:34,代码来源:Host.class.php
示例7: execute
/**
* @see EventListener::execute()
*/
public function execute($eventObj, $className, $eventName)
{
if ($eventObj->poll->messageType == 'post') {
// check permissions
require_once WBB_DIR . 'lib/data/post/Post.class.php';
$post = new Post($eventObj->poll->messageID);
if (!$post->postID) {
throw new IllegalLinkException();
}
require_once WBB_DIR . 'lib/data/thread/Thread.class.php';
$thread = new Thread($post->threadID);
$thread->enter();
require_once WBB_DIR . 'lib/data/board/Board.class.php';
$board = new Board($thread->boardID);
$eventObj->canVotePoll = $board->getPermission('canVotePoll');
// plug in breadcrumbs
WCF::getTPL()->assign(array('board' => $board, 'thread' => $thread, 'showThread' => true));
WCF::getTPL()->append('specialBreadCrumbs', WCF::getTPL()->fetch('navigation'));
// get other polls from this thread
if ($thread->polls > 1) {
require_once WCF_DIR . 'lib/data/message/poll/Poll.class.php';
$polls = array();
$sql = "SELECT \t\tpoll_vote.pollID AS voted,\n\t\t\t\t\t\t\tpoll_vote.isChangeable,\n\t\t\t\t\t\t\tpoll.*\n\t\t\t\t\tFROM \t\twcf" . WCF_N . "_poll poll\n\t\t\t\t\tLEFT JOIN \twcf" . WCF_N . "_poll_vote poll_vote\n\t\t\t\t\tON \t\t(poll_vote.pollID = poll.pollID\n\t\t\t\t\t\t\t" . (!WCF::getUser()->userID ? "AND poll_vote.ipAddress = '" . escapeString(WCF::getSession()->ipAddress) . "'" : '') . "\n\t\t\t\t\t\t\tAND poll_vote.userID = " . WCF::getUser()->userID . ")\n\t\t\t\t\tWHERE \t\tpoll.pollID IN (\n\t\t\t\t\t\t\t\tSELECT\tpollID\n\t\t\t\t\t\t\t\tFROM\twbb" . WBB_N . "_post\n\t\t\t\t\t\t\t\tWHERE\tthreadID = " . $thread->threadID . "\n\t\t\t\t\t\t\t\t\tAND isDeleted = 0\n\t\t\t\t\t\t\t\t\tAND isDisabled = 0\n\t\t\t\t\t\t\t\t\tAND pollID <> 0\n\t\t\t\t\t\t\t)\n\t\t\t\t\tORDER BY\tpoll.question";
$result = WCF::getDB()->sendQuery($sql);
while ($row = WCF::getDB()->fetchArray($result)) {
$polls[] = new Poll(null, $row, $eventObj->canVotePoll);
}
if (count($polls) > 1) {
WCF::getTPL()->assign(array('polls' => $polls, 'pollID' => $eventObj->pollID));
WCF::getTPL()->append('additionalSidebarContent', WCF::getTPL()->fetch('pollOverviewSidebar'));
}
}
}
}
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:37,代码来源:PollOverviewPagePostsListener.class.php
示例8: execute
/**
* @see lib/modules/CommandModule::execute()
*/
public function execute($user, $target, $message)
{
// split message
$messageEx = explode(' ', $message);
if ($target[0] != '#') {
$target = $messageEx[1];
unset($messageEx[1]);
$messageEx = array_values($messageEx);
}
$access = $this->bot->getAccess($target, Services::getUserManager()->getUser($user->getUuid())->accountname);
if ($access < $this->bot->getNeededAccess($target, $this->originalName)) {
return $this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.permissionDenied'));
}
if (count($messageEx) == 1) {
$sql = "SELECT\n\t\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\t\tchanserv_channel_accessLevel\n\t\t\t\tWHERE\n\t\t\t\t\tchannel = '" . escapeString($target) . "'\n\t\t\t\tORDER BY \n\t\t\t\t\taccessLevel DESC";
$result = Services::getDB()->sendQuery($sql);
while ($row = Services::getDB()->fetchArray($result)) {
$this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.' . $row['function']) . ': ' . $row['accessLevel']);
}
} else {
if (count($messageEx) == 3) {
if ($access < $messageEx[2]) {
return $this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.tooHigh'));
}
if (!$this->bot->getNeededAccess($target, $messageEx[1])) {
return $this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.unknown'));
}
$sql = "UPDATE\n\t\t\t\t\t\tchanserv_channel_accessLevel\n\t\t\t\t\tSET\n\t\t\t\t\t\taccessLevel = " . $messageEx[2] . "\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tfunction = '" . escapeString($messageEx[1]) . "'";
Services::getDB()->sendQuery($sql);
} else {
$this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.syntaxHint'));
}
}
}
开发者ID:Evil-Co-Legacy,项目名称:Evil-Co.de-Services,代码行数:37,代码来源:CommandAccess.class.php
示例9: save
/**
* Saves options.
*
* @param array $options
*/
public static function save($options)
{
foreach ($options as $optionID => $optionValue) {
$sql = "UPDATE\twcf" . WCF_N . "_option\n\t\t\t\tSET\toptionValue = '" . escapeString($optionValue) . "'\n\t\t\t\tWHERE\toptionID = " . $optionID;
WCF::getDB()->sendQuery($sql);
}
}
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:12,代码来源:Options.class.php
示例10: execute
/**
* @see EventListener::execute()
*/
public function execute($eventObj, $className, $eventName)
{
if (WCF::getUser()->userID && WCF::getUser()->getPermission('admin.general.canUseAcp') && !defined(get_class($eventObj) . '::DO_NOT_LOG')) {
// try to find existing session log
$sql = "SELECT\tsessionLogID\n\t\t\t\tFROM\twcf" . WCF_N . "_acp_session_log\n\t\t\t\tWHERE\tsessionID = '" . WCF::getSession()->sessionID . "'\n\t\t\t\t\tAND lastActivityTime >= " . (TIME_NOW - SESSION_TIMEOUT);
$row = WCF::getDB()->getFirstRow($sql);
if (!empty($row['sessionLogID'])) {
$sessionLogID = $row['sessionLogID'];
// update session log
$sql = "UPDATE\twcf" . WCF_N . "_acp_session_log\n\t\t\t\t\tSET\tlastActivityTime = " . TIME_NOW . "\n\t\t\t\t\tWHERE\tsessionLogID = " . $sessionLogID;
WCF::getDB()->registerShutdownUpdate($sql);
} else {
// create new session log
$sql = "INSERT INTO\twcf" . WCF_N . "_acp_session_log\n\t\t\t\t\t\t\t(sessionID, userID, ipAddress, hostname, userAgent, time, lastActivityTime)\n\t\t\t\t\tVALUES\t\t('" . WCF::getSession()->sessionID . "', " . WCF::getUser()->userID . ", '" . escapeString(WCF::getSession()->ipAddress) . "', '" . escapeString(@gethostbyaddr(WCF::getSession()->ipAddress)) . "', '" . escapeString(WCF::getSession()->userAgent) . "', " . TIME_NOW . ", " . TIME_NOW . ")";
WCF::getDB()->sendQuery($sql);
$sessionLogID = WCF::getDB()->getInsertID("wcf" . WCF_N . "_acp_session_log", 'sessionLogID');
}
// format request uri
$requestURI = WCF::getSession()->requestURI;
// remove directories
$URIComponents = explode('/', $requestURI);
$requestURI = array_pop($URIComponents);
// remove session url
$requestURI = preg_replace('/(?:\\?|&)s=[a-f0-9]{40}/', '', $requestURI);
// save access
$sql = "INSERT INTO\twcf" . WCF_N . "_acp_session_access_log\n\t\t\t\t\t\t(sessionLogID, packageID, ipAddress, time, requestURI, requestMethod, className)\n\t\t\t\tVALUES\t\t(" . $sessionLogID . ", " . PACKAGE_ID . ", '" . escapeString(WCF::getSession()->ipAddress) . "', " . TIME_NOW . ", '" . escapeString($requestURI) . "', '" . escapeString(WCF::getSession()->requestMethod) . "', '" . escapeString(get_class($eventObj)) . "')";
WCF::getDB()->registerShutdownUpdate($sql);
}
}
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:32,代码来源:SessionAccessLogListener.class.php
示例11: saved
/**
* saves the selected permissions
*/
protected function saved()
{
$sql = "UPDATE \twcf" . WCF_N . "_page_menu_item\n\t\t\tSET\tpermissions = '" . escapeString(implode(',', $this->selectedPermissions)) . "'\n\t\t\tWHERE\tmenuItemID = " . $this->eventObj->pageMenuItem->menuItemID;
WCF::getDB()->sendQuery($sql);
// clear cache
PageMenuItemEditor::clearCache();
}
开发者ID:Fighter456,项目名称:de.fighter456.wcf.pageMenuPermission,代码行数:10,代码来源:PageMenuItemAddFormPermissionListener.class.php
示例12: nettoyage_et_formatage_chaine_description_ics
function nettoyage_et_formatage_chaine_description_ics($chaine)
{
$retour = strip_tags($chaine);
$retour = escapeString($retour);
$retour = preg_replace("/\t/", " ", $retour);
$retour = preg_replace("/\n/", "\\\n", $retour);
}
开发者ID:alhousseyni,项目名称:gepi,代码行数:7,代码来源:ical.php
示例13: save
/**
* @see Form::save()
*/
public function save()
{
parent::save();
// save
$updateOptionValueUpdate = '';
foreach ($this->activeOptions as $option) {
if ($option['defaultValue'] != $option['optionValue']) {
$sql = "UPDATE\twcf" . WCF_N . "_user_option\n\t\t\t\t\tSET\tdefaultValue = '" . escapeString($option['optionValue']) . "'\n\t\t\t\t\tWHERE\toptionID = " . $option['optionID'];
WCF::getDB()->sendQuery($sql);
if (!empty($updateOptionValueUpdate)) {
$updateOptionValueUpdate .= ',';
}
$updateOptionValueUpdate .= 'userOption' . $option['optionID'] . "='" . escapeString($option['optionValue']) . "'";
}
}
// apply to existing users
if ($this->applyChangesToExistingUsers == 1 && !empty($updateOptionValueUpdate)) {
$sql = "UPDATE\twcf" . WCF_N . "_user_option_value\n\t\t\t\tSET\t" . $updateOptionValueUpdate;
WCF::getDB()->sendQuery($sql);
// reset sessions
Session::resetSessions();
}
// reset cache
WCF::getCache()->clearResource($this->cacheName . PACKAGE_ID);
// show success message
WCF::getTPL()->assign('success', true);
}
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:30,代码来源:UserOptionSetDefaultsForm.class.php
示例14: __construct
/**
* Gets the main data of the passed user (id, name or whole datablock)
* and pass it over to the "protected function initUser()".
* You can also create an emtpy user object e.g. to search for users.
*
* @param string $userID
* @param array $row
* @param string $username
* @param string $email
*/
public function __construct($userID, $row = null, $username = null, $email = null)
{
// set sql join to user_data table
$this->sqlSelects .= 'user_option.*,';
$this->sqlJoins .= "LEFT JOIN wcf" . WCF_N . "_user_option_value user_option ON (user_option.userID = user.userID)";
// execute sql statement
$sqlCondition = '';
if ($userID !== null) {
$sqlCondition = "user.userID = " . $userID;
} else {
if ($username !== null) {
$sqlCondition = "user.username = '" . escapeString($username) . "'";
} else {
if ($email !== null) {
$sqlCondition = "user.email = '" . escapeString($email) . "'";
}
}
}
if (!empty($sqlCondition)) {
$sql = "SELECT \t" . $this->sqlSelects . "\n\t\t\t\t\tuser.*\n\t\t\t\tFROM \twcf" . WCF_N . "_user user\n\t\t\t\t\t" . $this->sqlJoins . "\n\t\t\t\tWHERE \t" . $sqlCondition . $this->sqlGroupBy;
$row = WCF::getDB()->getFirstRow($sql);
}
// handle result set
parent::__construct($row);
}
开发者ID:CaribeSoy,项目名称:contest-wcf,代码行数:35,代码来源:User.class.php
示例15: setSetting
/**
* Sets a setting with an identifier and value.
*
* @param int userID
* @param string setting
* @param mixed value
* @param int expire time
*/
public static function setSetting($userID, $setting, $value, $expireTime = 0x7fffffff)
{
$svalue = serialize($value);
$sql = "REPLACE INTO ugml_user_setting\n\t\t\t\t(userID, setting, expireTime, value)\n\t\t\t\tVALUES\n\t\t\t\t(" . $userID . ", '" . escapeString($setting) . "', " . $expireTime . ", '" . escapeString($svalue) . "')";
WCF::getDB()->sendQuery($sql);
self::$settings[$userID][$setting] = $svalue;
Session::resetSessions($userID);
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:16,代码来源:UserSettings.class.php
示例16: execute
/**
* @see Action::execute()
*/
public function execute()
{
$sql = "UPDATE\twcf" . WCF_N . "_user_guestbook\n\t\t\tSET\tcommentIsDeleted = 1,\n\t\t\t\tcommentDeleteTime = " . TIME_NOW . ",\n\t\t\t\tcommentDeletedBy = '" . escapeString(WCF::getUser()->username) . "',\n\t\t\t\tcommentDeletedByID = " . WCF::getUser()->userID . "\n\t\t\tWHERE\tentryID = " . $this->entry->entryID;
WCF::getDB()->sendQuery($sql);
$this->executed();
HeaderUtil::redirect('index.php?page=UserGuestbook&userID=' . $this->entry->ownerID . '&entryID=' . $this->entry->entryID . SID_ARG_2ND_NOT_ENCODED . '#entry' . $this->entry->entryID);
exit;
}
开发者ID:0xLeon,项目名称:com.leon.wcf.user.guestbook.recyclebin,代码行数:11,代码来源:UserGuestbookCommentTrashAction.class.php
示例17: readParameters
/**
* @see Page::readParameters()
*/
public function readParameters()
{
parent::readParameters();
// parameters
if (isset($_REQUEST['username'])) {
$this->username = StringUtil::trim($_REQUEST['username']);
}
if (isset($_REQUEST['suspensionID'])) {
$this->suspensionID = intval($_REQUEST['suspensionID']);
}
if (isset($_REQUEST['status'])) {
$this->status = $_REQUEST['status'];
}
if (isset($_REQUEST['fromDay'])) {
$this->fromDay = intval($_REQUEST['fromDay']);
}
if (isset($_REQUEST['fromMonth'])) {
$this->fromMonth = intval($_REQUEST['fromMonth']);
}
if (isset($_REQUEST['fromYear'])) {
$this->fromYear = intval($_REQUEST['fromYear']);
}
if (isset($_REQUEST['untilDay'])) {
$this->untilDay = intval($_REQUEST['untilDay']);
}
if (isset($_REQUEST['untilMonth'])) {
$this->untilMonth = intval($_REQUEST['untilMonth']);
}
if (isset($_REQUEST['untilYear'])) {
$this->untilYear = intval($_REQUEST['untilYear']);
}
if (isset($_REQUEST['deletedUserSuspensionID'])) {
$this->deletedUserSuspensionID = intval($_REQUEST['deletedUserSuspensionID']);
}
// init list
$this->userSuspensionList = new UserSuspensionList();
// set conditions
$this->userSuspensionList->sqlConditions .= 'user_suspension.packageID = ' . PACKAGE_ID;
if (!empty($this->username)) {
$this->userSuspensionList->sqlConditions .= " AND user_suspension.userID = (SELECT userID FROM wcf" . WCF_N . "_user WHERE username = '" . escapeString($this->username) . "')";
}
if ($this->suspensionID) {
$this->userSuspensionList->sqlConditions .= " AND user_suspension.suspensionID = " . $this->suspensionID;
}
if ($this->status == 'active') {
$this->userSuspensionList->sqlConditions .= " AND (user_suspension.expires = 0 OR user_suspension.expires > " . TIME_NOW . ")";
} else {
if ($this->status == 'expired') {
$this->userSuspensionList->sqlConditions .= " AND user_suspension.expires > 0 AND user_suspension.expires < " . TIME_NOW;
}
}
if ($this->fromDay && $this->fromMonth && $this->fromYear) {
$this->userSuspensionList->sqlConditions .= " AND user_suspension.time > " . gmmktime(0, 0, 0, $this->fromMonth, $this->fromDay, $this->fromYear);
}
if ($this->untilDay && $this->untilMonth && $this->untilYear) {
$this->userSuspensionList->sqlConditions .= " AND user_suspension.time < " . gmmktime(0, 0, 0, $this->untilMonth, $this->untilDay, $this->untilYear);
}
}
开发者ID:joaocustodio,项目名称:EmuDevstore-1,代码行数:61,代码来源:UserSuspensionListPage.class.php
示例18: install
/**
* Installs scm.
*
* @see AbstractXMLPackageInstallationPlugin::install()
*/
public function install()
{
parent::install();
if (!($xml = $this->getXML())) {
return;
}
$scmXML = $xml->getElementTree('data');
foreach ($scmXML['children'] as $key => $block) {
if (!empty($block['children'])) {
switch ($block['name']) {
// install (or update existing) scm
case 'import':
foreach ($block['children'] as $scm) {
foreach ($scm['children'] as $child) {
// continue with next children if current tree is empty
if (!isset($child['cdata'])) {
continue;
}
$scm[$child['name']] = $child['cdata'];
}
// break operation if we encounter missing attribute
if (!isset($scm['attrs']['name'])) {
throw new SystemException('Required "name" attribute for scm item tag is missing.');
}
$scmName = $scm['attrs']['name'];
// insert into db
$sql = "INSERT INTO\twcf" . WCF_N . "_" . $this->tableName . "\r\n\t\t\t\t\t\t\t\t\t \t(packageID, scm)\r\n\t\t\t\t\t\t\t\tVALUES\t\t(" . $this->installation->getPackageID() . ", '" . strtolower($scmName) . "')\r\n\t\t\t\t\t\t\t\tON DUPLICATE KEY UPDATE scm = VALUES(scm)";
WCF::getDB()->sendQuery($sql);
// clear cache
SCMHelper::clearCache();
}
break;
// delete scm
// delete scm
case 'delete':
if ($package->getAction() == 'update') {
$itemNames = '';
foreach ($block['children'] as $scm) {
if (!isset($scm['attrs']['name'])) {
throw new SystemException('Required "name" attribute for scm tag is missing.');
}
if (!empty($itemNames)) {
$itemNames .= ',';
}
$itemNames .= "'" . escapeString($scm['attrs']['name']) . "'";
}
if (!empty($itemNames)) {
$sql = "DELETE FROM\twcf" . WCF_N . "_" . $this->tableName . "\r\n\t\t\t\t\t\t\t \t\tWHERE\t\tscm IN (" . $itemNames . ")\r\n\t\t\t\t\t\t\t\t\t\t&&\tpackageID = " . $this->installation->getPackageID();
WCF::getDB()->sendQuery($sql);
// clear cache
SCMHelper::clearCache();
}
}
break;
}
}
}
}
开发者ID:ZerGabriel,项目名称:PackageBuilder,代码行数:63,代码来源:SCMPackageInstallationPlugin.class.php
示例19: isAvailable
/**
* Returnes true if a page title is available
* @param string $title
* @param integer $hostID
*/
public static function isAvailable($title, $hostID)
{
$sql = "SELECT\r\n\t\t\t\t\tCOUNT(*) AS count\r\n\t\t\t\tFROM\r\n\t\t\t\t\twcf" . WCF_N . "_page\r\n\t\t\t\tWHERE\r\n\t\t\t\t\ttitle = '" . escapeString($title) . "'\r\n\t\t\t\tAND\r\n\t\t\t\t\thostID = " . $hostID;
$result = WCF::getDB()->getFirstRow($sql);
if ($result['count'] > 0) {
return false;
}
return true;
}
开发者ID:Evil-Co-Legacy,项目名称:Evil-Co.de-CMS,代码行数:14,代码来源:DynamicPageEditor.class.php
示例20: install
/**
* @see PackageInstallationPlugin::install()
*/
public function install()
{
$instructions = $this->installation->getInstructions();
if (isset($instructions[$this->tagName]['cdata'])) {
$licenseTextFiles = array($instructions[$this->tagName]);
} else {
$licenseTextFiles = $instructions[$this->tagName];
}
$this->loadInstalledLanguages();
foreach ($licenseTextFiles as $licenseTextFile) {
if ($licenseText = $this->readLicenseText($licenseTextFile)) {
// check required attributes
if (!isset($licenseTextFile['languagecode'])) {
throw new SystemException("required 'languagecode' attribute for 'licensetexts' tag is missing in '" . PackageArchive::INFO_FILE . "'");
}
// check language encoding
if (!Language::isSupported($licenseTextFile['languagecode'])) {
// unsupported encoding
continue;
}
$default = 0;
if (isset($licenseTextFile['default'])) {
$default = $licenseTextFile['default'];
}
if (array_key_exists($licenseTextFile['languagecode'], $this->installedLanguages)) {
$this->licenseTexts[$licenseTextFile['languagecode']] = array('languageID' => $this->installedLanguages[$licenseTextFile['languagecode']], 'licenseText' => $licenseText);
if ($default == 1) {
$this->defaultLanguage = $licenseTextFile['languagecode'];
}
}
}
}
if (count($this->licenseTexts) < 1) {
throw new SystemException("no license informations in your supported languages available in '" . PackageArchive::INFO_FILE . "'", 0);
}
if ($this->defaultLanguage == '') {
if (isset($this->licenseTexts[WCF::getLanguage()->getLanguageCode()])) {
$this->defaultLanguage = WCF::getLanguage()->getLanguageCode();
}
if ($this->defaultLanguage == '' && WCF::getLanguage()->getLanguageCode() == 'de-informal' && isset($this->licenseTexts['de'])) {
$this->defaultLanguage = 'de';
}
if (isset($this->licenseTexts['en'])) {
$this->defaultLanguage = 'en';
}
}
$this->promptLicenseConfirmation();
$itemInserts = '';
foreach ($this->licenseTexts as $languageCode => $licenseData) {
if (!empty($itemInserts)) {
$itemInserts .= ',';
}
$itemInserts .= "(\n\t\t\t\t" . intval($this->installation->getPackageID()) . ",\n\t\t\t\t" . intval($licenseData['languageID']) . ",\n\t\t\t\t" . ($this->defaultLanguage == $languageCode ? 1 : 0) . ",\n\t\t\t\t'" . escapeString($licenseData['licenseText']) . "'\n\t\t\t)";
}
$sql = "INSERT INTO wcf" . WCF_N . "_" . $this->tableName . "\n\t\t\tVALUES " . $itemInserts;
WCF::getDB()->sendQuery($sql);
}
开发者ID:pombredanne,项目名称:Show_License,代码行数:60,代码来源:ShowLicensePackageInstallationPlugin.class.php
注:本文中的escapeString函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论