本文整理汇总了PHP中initData函数的典型用法代码示例。如果您正苦于以下问题:PHP initData函数的具体用法?PHP initData怎么用?PHP initData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了initData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
function main()
{
global $numEpochs;
global $numPatterns;
global $patNum;
global $RMSerror;
// initiate the weights
initWeights();
// load in the data
initData();
// train the network
for ($j = 0; $j <= $numEpochs; $j++) {
for ($i = 0; $i < $numPatterns; $i++) {
//select a pattern at random
//srand();
$patNum = rand(0, $numPatterns - 1);
//calculate the current network output
//and error for this pattern
calcNet();
//change network weights
WeightChangesHO();
WeightChangesIH();
}
//display the overall network error
//after each epoch
calcOverallError();
if (gmp_mod($j, 50) == 0) {
print "epoch = " . $j . " RMS Error = " . $RMSerror . "</br>";
}
}
//training has finished
//display the results
displayResults();
}
示例2: getDisabledFunctions
function getDisabledFunctions()
{
global $INTERNAL, $GROUPS;
initData(array("INTERNAL", "GROUPS"));
$currentMIV = @ini_get("max_input_vars");
$currentMIVText = $currentMIV;
if (empty($currentMIV)) {
$currentMIV = 1000;
$currentMIVText = "unknown (default=1000)";
}
$message = null;
if (count($INTERNAL) > 0 && ($miv = (count($GROUPS) + count($INTERNAL)) * 75) > $currentMIV) {
$message .= "<span class=\"lz_index_error_cat\">PHP Configuration:<br></span> <span class=\"lz_index_red\">PHP configuration \"max_input_vars\" (see php.ini) must be increased to " . $miv . " (or greater).<br><br>Your current configuration is " . $currentMIVText . ".</span><br><br>";
}
if (!function_exists("file_get_contents") && ini_get('allow_url_fopen')) {
$message .= "<span class=\"lz_index_error_cat\">Disabled function: file_get_contents<br></span> <span class=\"lz_index_red\">LiveZilla requires the PHP function file_get_contents to be activated.</span><br><br>";
}
if (!function_exists("fsockopen")) {
$message .= "<span class=\"lz_index_error_cat\">Disabled function: fsockopen<br></span> <span class=\"lz_index_red\">LiveZilla requires the PHP function fsockopen to be activated.</span><br><br>";
}
if (!function_exists("iconv_mime_decode")) {
$message .= "<span class=\"lz_index_error_cat\">Missing PHP extension: ICONV<br></span> <span class=\"lz_index_orange\">LiveZilla requires the PHP extension iconv to parse emails. Please add the iconv package to your PHP configuration.</span><br><br>";
}
if (isset($_GET["warnings"])) {
if (!ini_get('allow_url_fopen')) {
$message .= "<span class=\"lz_index_error_cat\">Disabled wrapper: allow_url_fopen<br></span> <span class=\"lz_index_red\">LiveZilla requires allow_url_fopen to be activated.</span><br><br>";
}
if (@get_magic_quotes_gpc() == 1 || strtolower(@get_magic_quotes_gpc()) == "on") {
$message .= "<span class=\"lz_index_error_cat\">PHP Magic Quotes:</span><br><span class=\"lz_index_help_text\">This PHP feature has been DEPRECATED.</span><br><br>";
}
}
return $message;
}
示例3: array_push
$externalUser->Load();
array_push($externalUser->Browsers, new VisitorChat($externalUser->UserId, AJAXDecode($_POST[POST_EXTERN_USER_BROWSERID])));
define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), AJAXDecode($_POST[POST_EXTERN_USER_USERID])));
define("IS_FLOOD", $externalUser->Browsers[0]->FirstCall && isFlood(getIP(), @$_POST[POST_EXTERN_USER_USERID], true));
$externalUser->Browsers[0]->Load();
if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_LISTEN) {
$externalUser = listen($externalUser);
} else {
if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_MAIL) {
initData(false, true, false, false);
if ($externalUser->SaveTicket(AJAXDecode($_POST[POST_EXTERN_USER_GROUP]), $CONFIG) && ($CONFIG["gl_scom"] != null || $CONFIG["gl_sgom"] != null)) {
$externalUser->SendCopyOfMail(AJAXDecode($_POST[POST_EXTERN_USER_GROUP]), $CONFIG, $GROUPS);
}
} else {
if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_RATE) {
initData(true, false, false, false);
$externalUser->SaveRate(AJAXDecode($_POST[POST_EXTERN_REQUESTED_INTERNID]), $CONFIG);
} else {
if ($externalUser->Browsers[0]->Status != CHAT_STATUS_OPEN) {
$externalUser->Browsers[0]->CloseChat(7);
$externalUser->Browsers[0] = new VisitorChat($externalUser->UserId, AJAXDecode($_POST[POST_EXTERN_USER_BROWSERID]));
} else {
$externalUser->Browsers[0]->ChatId = AJAXDecode(@$_POST[POST_EXTERN_CHAT_ID]);
}
$externalUser->Browsers[0]->Waiting = false;
$externalUser->Browsers[0]->WaitingMessageDisplayed = null;
if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_RELOAD_GROUPS) {
if (isset($_GET[GET_EXTERN_USER_NAME]) && !empty($_GET[GET_EXTERN_USER_NAME])) {
$externalUser->Browsers[0]->Fullname = base64UrlDecode($_GET[GET_EXTERN_USER_NAME]);
}
if (isset($_GET[GET_EXTERN_USER_EMAIL]) && !empty($_GET[GET_EXTERN_USER_EMAIL])) {
示例4: reloadGroups
function reloadGroups($_user)
{
global $CONFIG, $INTERNAL, $GROUPS;
initData(true, false, false, true);
$groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG);
$groupbuilder->Generate();
if (isset($_POST[POST_EXTERN_REQUESTED_INTERNID]) && !empty($_POST[POST_EXTERN_REQUESTED_INTERNID])) {
$_user->Browsers[0]->DesiredChatPartner = getInternalSystemIdByUserId(AJAXDecode($_POST[POST_EXTERN_REQUESTED_INTERNID]));
}
$_user->AddFunctionCall("top.lz_chat_set_groups(\"" . $groupbuilder->Result . "\" ," . $groupbuilder->ErrorHTML . ");", false);
$_user->AddFunctionCall("lz_chat_release(" . parseBool($groupbuilder->GroupAvailable || isset($_POST[GET_EXTERN_RESET]) && strlen($groupbuilder->ErrorHTML) <= 2) . "," . $groupbuilder->ErrorHTML . ");", false);
return $_user;
}
示例5: buildTickets
function buildTickets($xml = "", $dle_xml = "", $ticketCount = 0, $itemCount = 0)
{
global $RESPONSE, $INTERNAL, $DUT;
if (empty($_POST[POST_INTERN_XMLCLIP_TICKETS_END_TIME])) {
return;
}
if (!isDataUpdate(POST_INTERN_DUT_TICKETS, DATA_UPDATE_KEY_TICKETS) && !isDataUpdate(POST_INTERN_DUT_EMAILS, DATA_UPDATE_KEY_EMAILS)) {
return;
}
initData(array("INPUTS"));
$permission = $INTERNAL[CALLER_SYSTEM_ID]->GetPermission(PERMISSION_MESSAGES);
if ($_POST[POST_INTERN_XMLCLIP_TICKETS_END_TIME] == XML_CLIP_NULL || !is_numeric($_POST[POST_INTERN_XMLCLIP_TICKETS_END_TIME])) {
$_POST[POST_INTERN_XMLCLIP_TICKETS_END_TIME] = 0;
}
if ($_POST[POST_INTERN_XMLCLIP_TICKETS_STATUS_END_TIME] == XML_CLIP_NULL || !is_numeric($_POST[POST_INTERN_XMLCLIP_TICKETS_STATUS_END_TIME])) {
$_POST[POST_INTERN_XMLCLIP_TICKETS_STATUS_END_TIME] = 0;
}
if ($_POST[POST_INTERN_XMLCLIP_EMAILS_END_TIME] == XML_CLIP_NULL || !is_numeric($_POST[POST_INTERN_XMLCLIP_EMAILS_END_TIME])) {
$_POST[POST_INTERN_XMLCLIP_EMAILS_END_TIME] = 0;
}
if ($_POST[POST_INTERN_XMLCLIP_TICKETS_LOG_END_TIME] == XML_CLIP_NULL || !is_numeric($_POST[POST_INTERN_XMLCLIP_TICKETS_LOG_END_TIME])) {
$_POST[POST_INTERN_XMLCLIP_TICKETS_LOG_END_TIME] = 0;
}
if ($_POST[POST_INTERN_XMLCLIP_TICKETS_COMMENTS_END_TIME] == XML_CLIP_NULL || !is_numeric($_POST[POST_INTERN_XMLCLIP_TICKETS_COMMENTS_END_TIME])) {
$_POST[POST_INTERN_XMLCLIP_TICKETS_COMMENTS_END_TIME] = 0;
}
$queries["messages"] = "FROM `" . DB_PREFIX . DATABASE_TICKETS . "` INNER JOIN `" . DB_PREFIX . DATABASE_TICKET_MESSAGES . "` ON `" . DB_PREFIX . DATABASE_TICKETS . "`.`id`=`" . DB_PREFIX . DATABASE_TICKET_MESSAGES . "`.`ticket_id` WHERE `time` >" . DBManager::RealEscape($_POST[POST_INTERN_XMLCLIP_TICKETS_END_TIME]) . " ORDER BY `time` ASC";
$queries["mails"] = "FROM `" . DB_PREFIX . DATABASE_TICKET_EMAILS . "` AS `t1` INNER JOIN `" . DB_PREFIX . DATABASE_MAILBOXES . "` AS `t2` ON `t1`.`mailbox_id`=`t2`.`id` WHERE `edited` >" . DBManager::RealEscape($_POST[POST_INTERN_XMLCLIP_EMAILS_END_TIME]) . " ORDER BY `edited` ASC";
$queries["status"] = "FROM `" . DB_PREFIX . DATABASE_TICKETS . "` INNER JOIN `" . DB_PREFIX . DATABASE_TICKET_EDITORS . "` ON `" . DB_PREFIX . DATABASE_TICKETS . "`.`id`=`" . DB_PREFIX . DATABASE_TICKET_EDITORS . "`.`ticket_id` WHERE `time` >" . DBManager::RealEscape($_POST[POST_INTERN_XMLCLIP_TICKETS_STATUS_END_TIME]) . " ORDER BY `time` ASC;";
$queries["log"] = "FROM `" . DB_PREFIX . DATABASE_TICKET_LOGS . "` WHERE `time` >" . DBManager::RealEscape($_POST[POST_INTERN_XMLCLIP_TICKETS_LOG_END_TIME]) . " ORDER BY `time` ASC;";
$queries["comments"] = "FROM `" . DB_PREFIX . DATABASE_TICKET_COMMENTS . "` WHERE `time` >" . DBManager::RealEscape($_POST[POST_INTERN_XMLCLIP_TICKETS_COMMENTS_END_TIME]) . " ORDER BY `time` ASC;";
$result = queryDB(true, "SELECT * " . $queries["messages"] . " LIMIT " . DBManager::RealEscape(DATA_ITEM_LOADS) . ";");
if ($result) {
while ($row = DBManager::FetchArray($result)) {
$ticket = new Ticket($row);
$full = in_array($ticket->Group, $INTERNAL[CALLER_SYSTEM_ID]->Groups) && $permission != PERMISSION_NONE || $permission == PERMISSION_FULL;
if ($full) {
$ticket->Messages[0]->LoadCustoms();
$ticket->Messages[0]->LoadAttachments();
}
$xml .= $ticket->GetXML($full);
$itemCount++;
$ticketCount++;
}
}
if ($ticketCount != DATA_ITEM_LOADS) {
$mailcount = $last = 0;
$result = queryDB(true, "SELECT `t1`.*,`t2`.`email` AS `receiver_mail` " . $queries["mails"] . " LIMIT " . DBManager::RealEscape(DATA_ITEM_LOADS * 5) . ";");
if ($result) {
while ($row = DBManager::FetchArray($result)) {
$permissione = $INTERNAL[CALLER_SYSTEM_ID]->GetPermission(22);
$full = $permissione != PERMISSION_NONE && (in_array($row["group_id"], $INTERNAL[CALLER_SYSTEM_ID]->Groups) && $permission != PERMISSION_NONE || $permission == PERMISSION_FULL);
$email = new TicketEmail($row);
$email->LoadAttachments();
$xml .= $email->GetXML($full);
$itemCount++;
if ($last != $row["edited"] && ++$mailcount >= DATA_ITEM_LOADS) {
break;
}
$last = $row["edited"];
}
}
$statuscount = $last = 0;
$result = queryDB(true, "SELECT * " . $queries["status"]);
if ($result) {
while ($row = DBManager::FetchArray($result)) {
if ($statuscount++ >= DATA_ITEM_LOADS && $last != $row["time"]) {
break;
}
$ticket = new TicketEditor($row["ticket_id"], $row);
$xml .= $ticket->GetXML(@$row["wait_begin"], @$row["last_update"]);
$itemCount++;
$last = $row["time"];
}
}
$logcount = $last = 0;
$result = queryDB(true, "SELECT * " . $queries["log"]);
if ($result) {
while ($row = DBManager::FetchArray($result)) {
if ($logcount++ >= DATA_ITEM_LOADS && $last != $row["time"]) {
break;
}
$xml .= "<lo c=\"" . base64_encode($row["created"]) . "\" ti=\"" . base64_encode($row["time"]) . "\" t=\"" . base64_encode($row["ticket_id"]) . "\" a=\"" . base64_encode($row["action"]) . "\" o=\"" . base64_encode($row["operator_id"]) . "\" v=\"" . base64_encode($row["value_old"]) . "\">" . base64_encode($row["value_new"]) . "</lo>\r\n";
$last = $row["time"];
$itemCount++;
}
}
$commentscount = $last = 0;
$result = queryDB(true, "SELECT * " . $queries["comments"]);
if ($result) {
while ($row = DBManager::FetchArray($result)) {
if ($commentscount++ >= DATA_ITEM_LOADS && $last != $row["time"]) {
break;
}
$xml .= "<c i=\"" . base64_encode($row["id"]) . "\" c=\"" . base64_encode($row["created"]) . "\" ti=\"" . base64_encode($row["time"]) . "\" t=\"" . base64_encode($row["ticket_id"]) . "\" m=\"" . base64_encode($row["message_id"]) . "\" o=\"" . base64_encode($row["operator_id"]) . "\">" . base64_encode($row["comment"]) . "</c>\r\n";
$last = $row["time"];
$itemCount++;
}
}
}
//.........这里部分代码省略.........
示例6: array
//print "=--------\n";
//foreach ($result as $a) print "= danach: " . $a['password'] . " : " . (isset($a['#']) ? $a['#'] : '####') . "\n";
print "\n";
return $result;
}
////////////////////////////////////////////////////////////////////////////////
// initialize test
$testPasswords = array();
for ($i = 0; $i < 20; $i++) {
$accountId = hash('md5', uniqid());
$userId = 'user-' . $accountId;
$testPasswords[] = array('account' => $userId, 'email' => $accountId . '@domain.tld', 'password' => sprintf('%s:{SHA512}NEWPASSWORD%s', $userId, uniqid()));
}
$fields = array('password');
initData(15);
$testPasswords = call('post', $testPasswords);
initData(15);
check(PASSWORDS, $testPasswords, $fields);
$testPasswords = call('put', $testPasswords);
check(PASSWORDS, $testPasswords, $fields);
$newTestPasswords = array();
foreach ($testPasswords as $key => $value) {
$userId = 'renamed-user-' . $accountId;
$newTestPasswords[] = array('oldaccount' => $value['account'], 'email' => $value['email'], 'account' => $userId, 'password' => sprintf('%s:{SHA512}NEWPASSWORD%s', $userId, uniqid()));
}
$newTestPasswords = call('put', $newTestPasswords);
check(PASSWORDS, $newTestPasswords, $fields);
check(PASSWORDS, $testPasswords, $fields, false);
call('delete', $testPasswords);
check(PASSWORDS, $testPasswords, $fields, false);
print "\n>>> file: " . PASSWORDS . "\n";
示例7: define
define("LIVEZILLA_PATH", "../../");
@set_time_limit(30);
require LIVEZILLA_PATH . "_definitions/definitions.inc.php";
require LIVEZILLA_PATH . "_lib/objects.global.users.inc.php";
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.protocol.inc.php";
require LIVEZILLA_PATH . "_lib/functions.internal.inc.php";
require LIVEZILLA_PATH . "_lib/objects.internal.inc.php";
@set_error_handler("handleError");
@error_reporting(E_ALL);
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
header("Keep-Alive: timeout=5, max=100");
initDataProvider();
initData(array("INTERNAL", "INPUTS"));
validate(true);
if (isValidated() && is("CALLER_SYSTEM_ID")) {
if ($INTERNAL[CALLER_SYSTEM_ID]->GetPermission(46) != PERMISSION_NONE) {
require "objects.apiv2.inc.php";
$apiv2 = new ApiV2(isset($_POST["p_json_pretty"]));
if ($apiv2->RunActions() && empty($apiv2->ErrorField) && !empty($apiv2->JSONOutput)) {
exit($apiv2->JSONOutput);
} else {
header("HTTP/1.1 400 Bad Request");
exit("HTTP/1.1 400 Bad Request" . $apiv2->GetErrorCodes());
}
}
}
header("HTTP/1.1 403 Forbidden");
exit("HTTP/1.1 403 Forbidden");
示例8: htmlentities
}
}
if ($online) {
$TRACKINGSCRIPT .= "lz_tracking_add_floating_button(" . $_GET["fbpos"] . "," . $shadow . $margin . "," . $_GET["fbw"] . "," . $_GET["fbh"] . ");";
}
}
} else {
$TRACKINGSCRIPT = "lz_tracking_set_sessid(\"" . htmlentities(CALLER_USER_ID) . "\",\"" . htmlentities(CALLER_BROWSER_ID) . "\");";
if (isset($_GET[GET_TRACK_URL]) && strpos(base64UrlDecode($_GET[GET_TRACK_URL]), GET_INTERN_COBROWSE) !== false) {
abortTracking(1);
}
$BROWSER = new VisitorBrowser(CALLER_BROWSER_ID, CALLER_USER_ID);
if ($EXTERNALUSER->FirstCall && !$BROWSER->IsFirstCall()) {
$EXTERNALUSER->FirstCall = false;
}
initData(false, false, false, true, true);
define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), CALLER_USER_ID));
define("IS_FLOOD", $BROWSER->IsFirstCall() && isFlood(getIP(), CALLER_USER_ID));
if (!getAvailability() || IS_FILTERED || IS_FLOOD) {
$BROWSER->Destroy();
exit("lz_tracking_stop_tracking();");
}
$BROWSER->Customs = getCustomArray();
if (isset($_GET[GET_EXTERN_USER_NAME]) && !empty($_GET[GET_EXTERN_USER_NAME])) {
$BROWSER->Fullname = cutString(base64UrlDecode($_GET[GET_EXTERN_USER_NAME]), 254);
} else {
$BROWSER->Fullname = getCookieValue("form_111");
}
if (isset($_GET[GET_EXTERN_USER_EMAIL]) && !empty($_GET[GET_EXTERN_USER_EMAIL])) {
$BROWSER->Email = cutString(base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL]), 254);
} else {
示例9: processCancelInvitation
function processCancelInvitation()
{
global $VISITOR;
if (isset($_POST[POST_INTERN_PROCESS_CANCEL_INVITATION])) {
$users = explode(POST_ACTION_VALUE_SPLITTER, utf8_decode($_POST[POST_INTERN_PROCESS_CANCEL_INVITATION]));
foreach ($users as $uid) {
$VISITOR[$uid]->ForceUpdate();
queryDB(true, "UPDATE `" . DB_PREFIX . DATABASE_CHAT_REQUESTS . "` SET `closed`=1,`canceled`='" . DBManager::RealEscape(CALLER_SYSTEM_ID) . "' WHERE `canceled`='' AND `accepted`=0 AND `declined`=0 AND `receiver_user_id`='" . DBManager::RealEscape($uid) . "';");
}
$VISITOR = null;
initData(array("VISITOR"));
}
}
示例10: setManagement
function setManagement($_prefix)
{
global $INTERNAL, $RESPONSE, $CONFIG, $GROUPS, $VISITOR;
administrationLog("setManagement", "", CALLER_SYSTEM_ID);
if (isValidated()) {
if (isset($INTERNAL[CALLER_SYSTEM_ID]) && ($INTERNAL[CALLER_SYSTEM_ID]->Level == USER_LEVEL_ADMIN || is_array($INTERNAL[CALLER_SYSTEM_ID]->WebsitesUsers) && in_array($CONFIG["gl_host"], $INTERNAL[CALLER_SYSTEM_ID]->WebsitesUsers))) {
$count = 0;
while (isset($_POST["p_operators_" . $count . "_id"])) {
if (!empty($_POST["p_operators_" . $count . "_delete"])) {
queryDB(true, "DELETE FROM `" . $_prefix . DATABASE_OPERATORS . "` WHERE `id`='" . DBManager::RealEscape($_POST["p_operators_" . $count . "_id"]) . "' LIMIT 1;");
} else {
$did = !empty($INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]) ? $INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]->AppDeviceId : "";
$abm = !empty($INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]) ? $INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]->AppBackgroundMode : false;
$aos = !empty($INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]) ? $INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]->AppOS : "";
$lac = !empty($INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]) ? $INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]->LastActive : 0;
$fac = !empty($INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]) ? $INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]->FirstActive : 0;
$wcl = !empty($INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]) ? $INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]->ClientWeb : 0;
$acl = !empty($INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]) ? $INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]->AppClient : 0;
$sta = !empty($INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]) ? $INTERNAL[$_POST["p_operators_" . $count . "_system_id"]]->Status : 2;
queryDB(true, "REPLACE INTO `" . $_prefix . DATABASE_OPERATORS . "` (`id`, `system_id`, `fullname`, `description`, `email`, `permissions`, `webspace`, `password`, `status`, `level`, `visitor_file_sizes`, `groups`, `groups_status`, `groups_hidden`,`reposts`, `languages`, `auto_accept_chats`, `login_ip_range`, `websites_users`, `websites_config`, `bot`, `wm`, `wmohca`,`first_active`,`last_active`,`sign_off`,`lweb`,`lapp`,`mobile_os`,`mobile_device_id`,`mobile_background`,`mobile_ex`,`max_chats`) VALUES ('" . DBManager::RealEscape($_POST["p_operators_" . $count . "_id"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_system_id"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_fullname"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_description"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_email"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_permissions"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_webspace"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_password"]) . "','" . $sta . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_level"]) . "','','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_groups"]) . "','','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_groups_hidden"]) . "','','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_languages"]) . "',0,'" . DBManager::RealEscape($_POST["p_operators_" . $count . "_lipr"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_websites_users"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_websites_config"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_bot"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_wm"]) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_wmohca"]) . "'," . $fac . "," . $lac . "," . (empty($_POST["p_operators_" . $count . "_deac"]) ? 0 : 2) . ",'" . DBManager::RealEscape($wcl ? 1 : 0) . "','" . DBManager::RealEscape($acl ? 1 : 0) . "','" . DBManager::RealEscape($aos) . "','" . DBManager::RealEscape($did) . "','" . DBManager::RealEscape($abm ? 1 : 0) . "','" . DBManager::RealEscape(@$_POST["p_operators_" . $count . "_mobile_ex"]) . "','" . DBManager::RealEscape(@$_POST["p_operators_" . $count . "_max_chats"]) . "');");
}
if (!empty($_POST["p_operators_" . $count . "_pp"])) {
queryDB(true, "DELETE FROM `" . DB_PREFIX . DATABASE_PROFILE_PICTURES . "` WHERE `webcam`='0' AND `internal_id`='" . DBManager::RealEscape($_POST["p_operators_" . $count . "_id"]) . "' LIMIT 1;");
queryDB(true, "INSERT INTO `" . DB_PREFIX . DATABASE_PROFILE_PICTURES . "` (`id` ,`internal_id`,`time` ,`webcam` ,`data`) VALUES ('" . DBManager::RealEscape(getId(32)) . "','" . DBManager::RealEscape($_POST["p_operators_" . $count . "_system_id"]) . "','" . DBManager::RealEscape(time()) . "',0,'" . DBManager::RealEscape($_POST["p_operators_" . $count . "_pp"]) . "');");
}
$count++;
}
$count = 0;
while (isset($_POST["p_groups_" . $count . "_id"])) {
if (!empty($_POST["p_groups_" . $count . "_delete"])) {
queryDB(true, "DELETE FROM `" . $_prefix . DATABASE_GROUPS . "` WHERE `id`='" . DBManager::RealEscape($_POST["p_groups_" . $count . "_id"]) . "' LIMIT 1;");
} else {
queryDB(true, "REPLACE INTO `" . $_prefix . DATABASE_GROUPS . "` (`id`, `dynamic`, `description`, `external`, `internal`, `created`, `email`, `standard`, `opening_hours`, `functions`, `chat_inputs_hidden`, `ticket_inputs_hidden`, `chat_inputs_required`, `ticket_inputs_required`, `chat_inputs_masked`, `ticket_inputs_masked`, `chat_inputs_cap`, `ticket_inputs_cap`, `max_chats`, `visitor_filters`, `chat_vouchers_required`, `pre_chat_html`, `post_chat_html`, `ticket_email_out`, `ticket_email_in`, `ticket_handle_unknown`, `chat_email_out`,`ticket_assignment`,`priorities`) VALUES ('" . DBManager::RealEscape($_POST["p_groups_" . $count . "_id"]) . "',0,'" . DBManager::RealEscape($_POST["p_groups_" . $count . "_description"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_external"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_internal"]) . "'," . time() . ",'" . DBManager::RealEscape($_POST["p_groups_" . $count . "_email"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_standard"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_opening_hours"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_functions"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_inputs_hidden"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_inputs_hidden"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_inputs_required"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_inputs_required"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_inputs_masked"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_inputs_masked"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_inputs_cap"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_inputs_cap"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_max_chats"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_visitor_filters"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_vouchers_required"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_pre_html"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_post_html"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_email_out"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_email_in"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_email_handling"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_chat_email_out"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_ticket_assign"]) . "','" . DBManager::RealEscape($_POST["p_groups_" . $count . "_priorities"]) . "');");
}
$count++;
}
queryDB(true, "DELETE FROM `" . $_prefix . DATABASE_OPERATOR_LOGINS . "`;");
$INTERNAL = $GROUPS = $VISITOR = null;
initData(array("INTERNAL", "GROUPS", "VISITOR"));
updatePredefinedMessages($_prefix);
updateSignatures($_prefix);
if (!empty($_POST["p_operators_0_id"])) {
queryDB(true, "DELETE FROM `" . $_prefix . DATABASE_AUTO_REPLIES . "` WHERE NOT EXISTS (SELECT * FROM `" . $_prefix . DATABASE_OPERATORS . "` WHERE `system_id` = `" . $_prefix . DATABASE_AUTO_REPLIES . "`.`owner_id`) AND NOT EXISTS (SELECT * FROM `" . $_prefix . DATABASE_GROUPS . "` WHERE `id` = `" . $_prefix . DATABASE_AUTO_REPLIES . "`.`owner_id`)");
queryDB(true, "DELETE FROM `" . $_prefix . DATABASE_PROFILE_PICTURES . "` WHERE NOT EXISTS (SELECT * FROM `" . $_prefix . DATABASE_OPERATORS . "` WHERE `system_id` = `" . $_prefix . DATABASE_PROFILE_PICTURES . "`.`internal_id`);");
queryDB(true, "DELETE FROM `" . $_prefix . DATABASE_PROFILES . "` WHERE NOT EXISTS (SELECT * FROM `" . $_prefix . DATABASE_OPERATORS . "` WHERE `system_id` = `" . $_prefix . DATABASE_PROFILES . "`.`id`);");
if (isset($_POST[POST_INTERN_EDIT_USER])) {
$combos = explode(";", $_POST[POST_INTERN_EDIT_USER]);
for ($i = 0; $i < count($combos); $i++) {
if (strpos($combos[$i], ",") !== false) {
$vals = explode(",", $combos[$i]);
if (strlen($vals[1]) > 0) {
$INTERNAL[$vals[0]]->ChangePassword($vals[1], true);
}
if ($vals[2] == 1) {
$INTERNAL[$vals[0]]->SetPasswordChangeNeeded(true);
}
}
}
}
}
setIdle(0);
$RESPONSE->SetStandardResponse(1, "");
}
}
}
示例11: foreach
print "=--------\n";
foreach ($result as $a) {
print "= danach: " . $a['emailpattern'] . " : " . (isset($a['#']) ? $a['#'] : '####') . "\n";
}
print "\n";
return $result;
}
$fields = array('emailpattern', 'account');
////////////////////////////////////////////////////////////////////////////////
// initialize test
$testAddresss = array();
for ($i = 0; $i < 20; $i++) {
$addressId = hash('md5', uniqid());
$userId = 'user-' . $addressId;
$testAddresss[] = array('account' => $userId, 'emailpattern' => $addressId . '@domain.tld');
}
initData(15, 100);
//$testAddresss = doTest('POST', $testAddresss);
$testAddresss = call('post', $testAddresss);
initData(15, 500);
check(ADDRESSES, $testAddresss, $fields);
//$testAddresss = doTest('PUT', $testAddresss);
$testAddresss = call('put', $testAddresss);
check(ADDRESSES, $testAddresss, $fields);
$loadedTestAddresss = call('get', $testAddresss);
check(ADDRESSES, $loadedTestAddresss, $fields);
find($testAddresss, $loadedTestAddresss);
//$testAddresss = doTest('DELETE', $testAddresss);
call('delete', $testAddresss);
check(ADDRESSES, $testAddresss, $fields, false);
print "\n>>> file: " . ADDRESSES . "\n";
示例12: CreateFloodFilter
static function CreateFloodFilter($_ip, $_userId)
{
global $FILTERS;
initData(array("FILTERS"));
foreach ($FILTERS->Filters as $currentFilter) {
if ($currentFilter->IP == $_ip && $currentFilter->Activeipaddress == 1 && $currentFilter->Activestate == 1) {
return;
}
}
Filter::Create($_ip, $_userId, "AUTO FLOOD FILTER");
}
示例13: define
define("LIVEZILLA_PATH", "./");
}
@ini_set('session.use_cookies', '0');
@error_reporting(E_ALL);
$content_frames = array("lz_chat_frame.3.2.lgin.1.0", "lz_chat_frame.3.2.mail.1.0", "lz_chat_frame.3.2.chat.1.0", "lz_chat_frame.3.2.chat.0.0", "lz_chat_frame.3.2.chat.2.0");
require LIVEZILLA_PATH . "_lib/functions.external.inc.php";
require LIVEZILLA_PATH . "_lib/objects.external.inc.php";
@set_time_limit($CONFIG["timeout_chats"]);
if (!isset($_GET["file"])) {
@set_error_handler("handleError");
}
if (!isset($_GET["browid"])) {
exit;
}
languageSelect();
initData(array("INTERNAL", "GROUPS", "FILTERS", "INPUTS"));
$USER = new Visitor(base64UrlDecode(getParam(GET_TRACK_USERID)));
$USER->Load();
array_push($USER->Browsers, new VisitorChat($USER->UserId, $USER->UserId . "_OVL"));
array_push($USER->Browsers, $BROWSER);
$GroupBuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG, $USER->Browsers[0]->DesiredChatGroup, $USER->Browsers[0]->DesiredChatPartner, false);
$GroupBuilder->Generate(null, true);
$USER->Browsers[0]->Overlay = true;
$USER->Browsers[0]->Load();
if ($USER->Browsers[0]->FirstCall) {
$USER->AddFunctionCall("lz_chat_init_data_change(null,null);", false);
}
if (IS_FILTERED) {
$USER->Browsers[0]->CloseChat();
$USER->Browsers[0]->Destroy();
$USER->AddFunctionCall("lz_tracking_remove_overlay_chat();", true);
示例14: utf8_encode
require LIVEZILLA_PATH . "extern.php";
$response = utf8_encode("<?xml version=\"1.0\" encoding=\"UTF-8\" ?><livezilla_js>" . base64_encode(isset($EXTERNSCRIPT) ? $EXTERNSCRIPT : "") . "</livezilla_js>");
} else {
if (isset($_POST["p_request"]) && $_POST["p_request"] == CALLER_TYPE_INTERNAL) {
define("CALLER_TYPE", CALLER_TYPE_INTERNAL);
define("CALLER_TIMEOUT", $CONFIG["timeout_clients"]);
header("Connection: close");
header("Cache-Control: no-cache, must-revalidate");
header("Content-Type: text/xml; charset=UTF-8");
require LIVEZILLA_PATH . "intern.php";
$response = utf8_encode($response);
} else {
if (isset($_GET[GET_SERVER_REQUEST_TYPE]) && $_GET[GET_SERVER_REQUEST_TYPE] == "cronjob" && !empty($_GET["cjid"]) && $_GET["cjid"] == $CONFIG["gl_cjid"]) {
define("CALLER_TYPE", "cronjob");
define("CALLER_TIMEOUT", 360);
initData(array("INTERNAL", "GROUPS"));
$response = DB_CONNECTION ? "Success" : "No database connection";
}
}
}
}
if (DB_CONNECTION && is("CALLER_TYPE") && (!empty($CONFIG["gl_cjfs"]) || CALLER_TYPE == "cronjob") && !is("SERVERSETUP") && !is("LOGIN")) {
cronJobs(CALLER_TYPE == "cronjob");
}
}
if (!isset($response)) {
exit(getFile(TEMPLATE_HTML_SUPPORT));
}
sendPushMessages();
unloadDataProvider();
exit($response);
示例15: GetMatchingVoucher
public static function GetMatchingVoucher($_groupId, $_voucherid)
{
global $CONFIG, $GROUPS;
initData(array("GROUPS"));
$ticket = new CommercialChatVoucher("", $_voucherid);
$ticket->Load();
$result = queryDB(true, $d = "SELECT *,`t1`.`id` AS `voucherid`, SUM(`chat_time_max`) AS `chat_time_max`, SUM(`chat_time`) AS `chat_time`, SUM(`chat_sessions`) AS `chat_sessions`, SUM(`chat_sessions_max`) AS `chat_sessions_max`, MAX(`expires`) AS `expires` FROM `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_VOUCHERS . "` AS `t1` INNER JOIN `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_TYPES . "` AS `t2` ON `t1`.`tid`=`t2`.`id` WHERE `t1`.`id`='" . DBManager::RealEscape($_voucherid) . "' ORDER BY `created` ASC;");
while ($row = @DBManager::FetchArray($result)) {
if (!empty($CONFIG["db"]["cct"][$row["tid"]])) {
$ticket = new CommercialChatVoucher($row);
if (in_array($row["tid"], $GROUPS[$_groupId]->ChatVouchersRequired)) {
return $ticket;
}
}
}
return null;
}