本文整理汇总了PHP中getPostData函数的典型用法代码示例。如果您正苦于以下问题:PHP getPostData函数的具体用法?PHP getPostData怎么用?PHP getPostData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getPostData函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: uploadConfirmPerl
/**
* Outputs frontpage HTML
*
* @return Nothing
*/
function uploadConfirmPerl()
{
global $database, $my, $acl, $mosConfig_absolute_path, $mosConfig_mailfrom, $mosConfig_fromname, $mosConfig_live_site, $Itemid, $mosConfig_sitename;
$c = hwd_vs_Config::get_instance();
$db = & JFactory::getDBO();
$my = & JFactory::getUser();
$acl= & JFactory::getACL();
// get server configuration data
require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'serverconfig.hwdvideoshare.php');
$s = hwd_vs_SConfig::get_instance();
//******************************************************************************************************
// ATTENTION: THIS FILE HEADER MUST REMAIN INTACT. DO NOT DELETE OR MODIFY THIS FILE HEADER.
//
// Name: ubr_finished.php
// Revision: 1.3
// Date: 2/18/2008 5:36:57 PM
// Link: http://uber-uploader.sourceforge.net
// Initial Developer: Peter Schmandra http://www.webdice.org
// Description: Show successful file uploads.
//
// Licence:
// The contents of this file are subject to the Mozilla Public
// License Version 1.1 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of
// the License at http://www.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS
// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
// implied. See the License for the specific language governing
// rights and limitations under the License.
//
//***************************************************************************************************************
//***************************************************************************************************************
// The following possible query string formats are assumed
//
// 1. ?upload_id=upload_id
// 2. ?about=1
//****************************************************************************************************************
$THIS_VERSION = "1.3"; // Version of this file
$UPLOAD_ID = ''; // Initialize upload id
require_once(JPATH_SITE.DS.'components'.DS.'com_hwdvideoshare'.DS.'assets'.DS.'uploads'.DS.'perl'.DS.'ubr_ini.php');
require_once(JPATH_SITE.DS.'components'.DS.'com_hwdvideoshare'.DS.'assets'.DS.'uploads'.DS.'perl'.DS.'ubr_lib.php');
require_once(JPATH_SITE.DS.'components'.DS.'com_hwdvideoshare'.DS.'assets'.DS.'uploads'.DS.'perl'.DS.'ubr_finished_lib.php');
if($PHP_ERROR_REPORTING){ error_reporting(E_ALL); }
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.date('r'));
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', FALSE);
header('Pragma: no-cache');
if(preg_match("/^[a-zA-Z0-9]{32}$/", $_GET['upload_id'])){ $UPLOAD_ID = $_GET['upload_id']; }
elseif(isset($_GET['about']) && $_GET['about'] == 1){ kak("<u><b>UBER UPLOADER FINISHED PAGE</b></u><br>UBER UPLOADER VERSION = <b>" . $UBER_VERSION . "</b><br>UBR_FINISHED = <b>" . $THIS_VERSION . "<b><br>\n", 1 , __LINE__); }
else{ kak("<font color='red'>ERROR</font>: Invalid parameters passed<br>", 1, __LINE__); }
//Declare local values
$_XML_DATA = array(); // Array of xml data read from the upload_id.redirect file
$_CONFIG_DATA = array(); // Array of config data read from the $_XML_DATA array
$_POST_DATA = array(); // Array of posted data read from the $_XML_DATA array
$_FILE_DATA = array(); // Array of 'FileInfo' objects read from the $_XML_DATA array
$_FILE_DATA_TABLE = ''; // String used to store file info results nested between <tr> tags
$_FILE_DATA_EMAIL = ''; // String used to store file info results
$xml_parser = new XML_Parser; // XML parser
$xml_parser->setXMLFile($TEMP_DIR, $_REQUEST['upload_id']); // Set upload_id.redirect file
$xml_parser->setXMLFileDelete($DELETE_REDIRECT_FILE); // Delete upload_id.redirect file when finished parsing
$xml_parser->parseFeed(); // Parse upload_id.redirect file
// Display message if the XML parser encountered an error
if($xml_parser->getError()){ kak($xml_parser->getErrorMsg(), 1, __LINE__); }
$_XML_DATA = $xml_parser->getXMLData(); // Get xml data from the xml parser
$_CONFIG_DATA = getConfigData($_XML_DATA); // Get config data from the xml data
$_POST_DATA = getPostData($_XML_DATA); // Get post data from the xml data
$_FILE_DATA = getFileData($_XML_DATA); // Get file data from the xml data
// Output XML DATA, CONFIG DATA, POST DATA, FILE DATA to screen and exit if DEBUG_ENABLED.
if($DEBUG_FINISHED){
debug("<br><u>XML DATA</u>", $_XML_DATA);
debug("<u>CONFIG DATA</u>", $_CONFIG_DATA);
debug("<u>POST DATA</u>", $_POST_DATA);
debug("<u>FILE DATA</u><br>", $_FILE_DATA);
exit;
}
/////////////////////////////////////////////////////////////////////////////////////////////////
//
// *** ATTENTION: ENTER YOUR CODE HERE !!! ***
//.........这里部分代码省略.........
开发者ID:rkern21,项目名称:videoeditor,代码行数:101,代码来源:uploads.php
示例2: dirname
<?php
include_once dirname(__FILE__) . "/../common/common.php";
include_once dirname(__FILE__) . '/../business/AuthB.php';
include_once dirname(__FILE__) . '/../database/Trip.php';
include_once dirname(__FILE__) . '/../database/Media.php';
$auth = new AuthB();
if (!$auth->canGetMedia()) {
$response = errorResponse(RESPONSE_UNAUTHORIZED);
} else {
if (isPutMethod()) {
$data = getPostData();
$tripId = '';
if (isset($data['tripId'])) {
$tripId = $data['tripId'];
}
$mediaId = '';
if (isset($data['mediaId'])) {
$mediaId = $data['mediaId'];
}
if ($tripId === '' || $mediaId === '') {
$response = errorResponse(RESPONSE_BAD_REQUEST);
} else {
$object = new Media($tripId, $mediaId);
if (isset($data['type'])) {
$object->setType($data['type']);
}
if (isset($data['caption'])) {
$object->setCaption($data['caption']);
}
if (isset($data['timestamp'])) {
开发者ID:egrivel,项目名称:vacationblog,代码行数:31,代码来源:putMedia.php
示例3: isNewVersionAvailable
/**
* Checks if there's a new version of facileManager available
*
* @since 1.0
* @package facileManager
*/
function isNewVersionAvailable($package, $version)
{
$fm_site_url = 'http://www.facilemanager.com/check/';
$data['package'] = $package;
$data['version'] = $version;
$method = 'update';
/** Are software updates enabled? */
if (!getOption('software_update')) {
return false;
}
/** Disable check until user has upgraded database to 1.2 */
if (getOption('fm_db_version') < 32) {
return false;
}
/** Should we be running this check now? */
$last_version_check = getOption('version_check', 0, $package);
if (!($software_update_interval = getOption('software_update_interval'))) {
$software_update_interval = 'week';
}
if (!$last_version_check) {
$last_version_check['timestamp'] = 0;
$last_version_check['data'] = null;
$method = 'insert';
} elseif (strpos($last_version_check['data'], $version)) {
$last_version_check['timestamp'] = 0;
}
if (strtotime($last_version_check['timestamp']) < strtotime("1 {$software_update_interval} ago")) {
$data['software_update_tree'] = getOption('software_update_tree');
$result = getPostData($fm_site_url, $data);
setOption('version_check', array('timestamp' => date("Y-m-d H:i:s"), 'data' => $result), $method, true, 0, $package);
return $result;
}
return $last_version_check['data'];
}
开发者ID:Vringe,项目名称:facileManager,代码行数:40,代码来源:functions.php
示例4: errorsInForm
}
/**
* Check how many errors there's in the form data
*/
function errorsInForm($postData)
{
$errors = array();
// first_name
if (!$postData['first_name']) {
array_push($errors, 'first_name');
}
// email
if ($postData['email'] != "" and !filter_var($postData['email'], FILTER_VALIDATE_EMAIL) or $postData['email'] == "") {
array_push($errors, 'email');
}
return $errors;
}
// --------- PROCESS ---------
// Input
$postData = getPostData();
$errorsInForm = errorsInForm($postData);
if (count($errorsInForm) == 0) {
$data = array('first_name' => $postData['first_name'], 'email' => $postData['email']);
signupEngagingNetworks($data);
}
// --------- Output Json
$response = array();
$response['error_count'] = count($errorsInForm);
$response['errors'] = $errorsInForm;
$response['post'] = $postData;
generate_json_output($response);
开发者ID:osvik,项目名称:photo-petition,代码行数:31,代码来源:insert-record.php
示例5: kak
// XML parser
$xml_parser->setXMLFile($TEMP_DIR, $_GET['upload_id']);
// Set upload_id.redirect file
$xml_parser->setXMLFileDelete($_INI['delete_redirect_file']);
// Delete upload_id.redirect file when finished parsing
$xml_parser->parseFeed();
// Parse upload_id.redirect file
// Display message if the XML parser encountered an error
if ($xml_parser->getError()) {
kak($xml_parser->getErrorMsg(), 1, __LINE__, $_INI['path_to_css_file']);
}
$_XML_DATA = $xml_parser->getXMLData();
// Get xml data from the xml parser
$_CONFIG_DATA = getConfigData($_XML_DATA);
// Get config data from the xml data
$_POST_DATA = getPostData($_XML_DATA);
// Get post data from the xml data
$_FILE_DATA = getFileData($_XML_DATA);
// Get file data from the xml data
// Output XML DATA, CONFIG DATA, POST DATA, FILE DATA to screen and exit if DEBUG_ENABLED.
if ($_INI['debug_finished']) {
debug("<br><u>XML DATA</u>", $_XML_DATA);
debug("<u>CONFIG DATA</u>", $_CONFIG_DATA);
debug("<u>POST DATA</u>", $_POST_DATA);
debug("<u>FILE DATA</u>", $_FILE_DATA);
exit;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
// *** ATTENTION: ENTER YOUR CODE HERE !!! ***
//
开发者ID:sushilfl88,项目名称:test-uber,代码行数:31,代码来源:ubr_finished.php
示例6: getPostData
<?php
require_once 'startup.php';
if (getPostData("formId") == "addExistingProject" && getPostData("projectName") && getPostData("action") == ecgettext("OK")) {
$projectName = getPostData("projectName");
$updateManager = new UpdateManager();
$update = $updateManager->createUpdate("runProcedure");
$update->addItem("projectName", "/plugins/@PLUGIN_KEY@/project");
$update->addItem("procedureName", "AddProject");
$update->addItem("actualParameter", array("actualParameterName" => "project_name", "value" => $projectName));
$updateManager->handleUpdates();
$response = $update->getResponse();
$id = $response->get("jobId");
Data::$queries["getJobInfo"] = array("request" => "getJobInfo", "constantArgs" => array("jobId", $id), "result" => "job");
$limit = 10;
$i = 0;
while (1) {
$result = QueryManager::handleQueryNow("getJobInfo");
if ($i == $limit || $result->get("status") == "completed") {
break;
}
sleep(1);
$i++;
}
$jobId = $result->get("jobId");
$jobName = $result->get("jobName");
$status = $result->get("status");
if ($status != "completed") {
Error::report("Add job '{$jobName}' did not complete after {$limit} seconds.", "Please browse to the job details page to inspect why the job hasn't completed.");
}
$outcome = $result->get("outcome");
开发者ID:remtcs,项目名称:electriccommander,代码行数:31,代码来源:addProject.php
示例7: getPostData
include_once 'classes/sessions.php';
include_once 'classes/login_check.php';
//upload include
require 'uploader_conlib.php';
$config_video_title_length = $config['video_title_length'];
//===================================START OF UPLOADER (ubber)================================
$THIS_VERSION = "4.0";
/////////////////////////////////////////////////////////////////
// The following possible query string formats are assumed
//
// 1. ?upload_dir=tmp_sid&path_to_upload_dir
// 2. ?cmd=about
/////////////////////////////////////////////////////////////////
// Hard-code the 'temp_dir' value here instead of passing it in the address bar.
$temp_dir = $_REQUEST['temp_dir'];
$_POST_DATA = getPostData($temp_dir, $_REQUEST['tmp_sid']);
$title = $_POST_DATA['title'];
$description = $_POST_DATA['description'];
$tags = $_POST_DATA['tags'];
$location_recorded = $_POST_DATA['location_recorded'];
$allow_comments = $_POST_DATA['allow_comments'];
$allow_embedding = $_POST_DATA['allow_embedding'];
$public_private = $_POST_DATA['public_private'];
$channel_id = $_POST_DATA['channel'];
$channel_name = $_POST_DATA['channel_name'];
$sub_cat = $_POST_DATA['sub_cat'];
$vid_response = $_POST_DATA['vid_response'];
$response_id = $_POST_DATA['response_id'];
$of_channel_id = $_POST_DATA['of_channel_id'];
$of_channel = $_POST_DATA['of_channel'];
/////////////////////////////////////////////////////////////////////
开发者ID:tssgery,项目名称:phpmotion,代码行数:31,代码来源:uploader_finished.php
示例8: ww_fp_options
function ww_fp_options()
{
echo '<div class="wrap">';
global $wpdb;
if (isset($_GET['settings']) && $_GET['settings'] == '1') {
if (isset($_POST['fj-set-submit'])) {
update_option('f_img_path', $_POST['f_img_path']);
update_option('r_img_path', $_POST['r_img_path']);
echo '<div id="message" class="updated fade"><p><strong>Changes Saved</strong></p></div>';
}
echo '<div class="wrap">';
echo '<div style="float:left;"><h2>Follow My Blog Post Options</h2></div><div style="float:right;margin-top:24px;"><a href="?page=followpostsettings">Main Page</a></div>';
echo '<div style="clear:both;">';
echo '<form action="" method="post">';
echo '<p>
<label for="wppa-thumbsize">Follow Me: <small>Changing the URL of follow me image.</small></label><br />
<input type="text" size="60" name="f_img_path" id="wppa-tumbsize" value="' . get_option('f_img_path') . '" />
</p>';
echo '<p>
<label for="wppa-fullsize">Remove Me: <small> Changing the URL of remove me image.</small></label><br />
<input type="text" size="60" name="r_img_path" id="wppa-fullsize" value="' . get_option('r_img_path') . '" />
</p>';
echo '<p>
<input type="submit" name="fj-set-submit" value="Save Changes" />
</p>';
echo '</form>';
echo '</div>';
echo '</div>';
} else {
if (isset($_GET['postid']) && $_GET['postid'] != '') {
$mydata = getPostData($_GET['postid']);
$post_title = $mydata['post_title'];
if (isset($_GET['log']) && $_GET['log'] != '') {
$log = $_GET['log'];
echo "<h2>View Logs</h2><br />";
$sel2 = "SELECT comment_author_email FROM " . PLUGIN_Follow_Table . " where id = '" . $log . "'";
$exe = mysql_query($sel2);
$data1 = mysql_fetch_assoc($exe);
$email_ = $data1['comment_author_email'];
$sel2 = "SELECT * FROM " . PLUGIN_Follow_Log_Table . " where user_email = '" . $email_ . "' and comment_post_ID = '" . $_GET['postid'] . "'";
$albums2 = $wpdb->get_results($sel2, 'ARRAY_A');
echo '<div style="clear:both">';
echo '<div style="float:left;height:20px;width:100px;"><b>User Mail Id : </b></div><div style="float:left;" >' . $email_ . '</div>';
echo '<div style="clear:both;float:left;height:20px;width:100px;"><b>Post Title : </b></div><div style="float:left;" >' . $post_title . '</div>';
echo '</div>';
if (!empty($albums2)) {
echo '<table class="widefat" >
<thead>
<tr>
<th scope="col">Mail Subject</th>
<th scope="col">Mail Body</th>
<th scope="col">Date</th>
</tr>
</thead>';
$alt = ' class="alternate" ';
foreach ($albums2 as $data) {
$mail_data = $data['mail_data'];
$mailArr = explode('%$%$%', $mail_data);
$datetime = new DateTime($data['log_date']);
$newdate = $datetime->format('jS, F Y h:i:s A');
?>
<tr <?php
echo $alt;
?>
>
<td><?php
echo $mailArr[0];
?>
</td>
<td><?php
echo nl2br($mailArr[1]);
?>
</td>
<td><?php
echo $newdate;
?>
</td>
</tr>
<?php
if ($alt == '') {
$alt = ' class="alternate" ';
} else {
$alt = '';
}
}
?>
</table>
<?php
} else {
echo "<div style='clear:both;margin-top:50px;'><b>NO Mail Sent</b></div>";
}
} else {
if (isset($_POST['Sub']) && $_POST['Sub'] == 'Subscribe') {
//print_r($_POST);
if (!empty($_POST['chkid'])) {
for ($k_ = 0; $k_ < count($_POST['chkid']); $k_++) {
$udp = "Update " . PLUGIN_Follow_Table . " SET follow_status = 1 where id = '" . $_POST['chkid'][$k_] . "'";
//.........这里部分代码省略.........
开发者ID:billadams,项目名称:forever-frame,代码行数:101,代码来源:index.php
示例9: processUpdateMethod
/**
* Processes the update method and prepares the system
*
* @since 1.0
* @package facileManager
*
* @param string $module_name Module currently being used
* @param string $update_method User entered update method
* @return string
*/
function processUpdateMethod($module_name, $update_method, $data, $url)
{
global $argv;
switch ($update_method) {
/** cron */
case 'c':
$tmpfile = sys_get_temp_dir() . '/crontab.facileManager';
$dump = shell_exec('crontab -l | grep -v ' . $argv[0] . '> ' . $tmpfile . ' 2>/dev/null');
/** Handle special cases */
if (PHP_OS == 'SunOS') {
for ($x = 0; $x < 12; $x++) {
$minopt[] = sprintf("%02d", $x * 5);
}
$minutes = implode(',', $minopt);
unset($minopt);
} else {
$minutes = '*/5';
}
$cmd = "echo '" . $minutes . ' * * * * ' . findProgram('php') . ' ' . dirname(__FILE__) . '/' . $module_name . '/' . basename($argv[0]) . " cron' >> {$tmpfile} && " . findProgram('crontab') . ' ' . $tmpfile;
$cron_update = system($cmd, $retval);
unlink($tmpfile);
if ($retval) {
echo fM(" --> The crontab cannot be created.\n --> {$cmd}\n");
} else {
echo fM(" --> The crontab has been created.\n");
}
return 'cron';
break;
/** ssh */
/** ssh */
case 's':
$raw_data = getPostData(str_replace('genserial', 'ssh=user', $url), $data);
$user = $data['compress'] ? @unserialize(gzuncompress($raw_data)) : @unserialize($raw_data);
$result = $user ? 'ok' : 'failed';
if ($result == 'failed') {
echo fM("Installation failed. No SSH user found for this account.\n");
exit(1);
}
/** Get local users */
$passwd_users = explode("\n", preg_replace('/:.*/', '', @file_get_contents('/etc/passwd')));
/** Add fm_user */
echo fM(" --> Attempting to create system user ({$user})...");
if (!($ssh_dir = addUser(array($user, 'facileManager'), $passwd_users))) {
echo "failed\n";
echo fM("\nInstallation aborted.\n");
exit(1);
} else {
echo "ok\n";
}
/** Add ssh public key */
echo fM(" --> Installing SSH key...");
$raw_data = getPostData(str_replace('genserial', 'ssh=key_pub', $url), $data);
$raw_data = $data['compress'] ? @unserialize(gzuncompress($raw_data)) : @unserialize($raw_data);
if (strpos($raw_data, 'ssh-rsa') !== false) {
$result = strpos(@file_get_contents($ssh_dir . '/authorized_keys2'), $raw_data) === false ? @file_put_contents($ssh_dir . '/authorized_keys2', $raw_data, FILE_APPEND) : true;
@chown($ssh_dir . '/authorized_keys2', $user);
@chmod($ssh_dir . '/authorized_keys2', 0600);
if ($result !== false) {
$result = 'ok';
}
} else {
$result = 'failed';
}
echo $result . "\n\n";
if ($result == 'failed') {
echo fM("Installation failed. No SSH key found for this account.\n");
exit(1);
}
/** Add an entry to sudoers */
$sudoers_line = "{$user}\tALL=(root)\tNOPASSWD: " . findProgram('php') . ' ' . $argv[0] . ' *';
addSudoersConfig($module_name, $sudoers_line, $user);
return 'ssh';
break;
/** http(s) */
/** http(s) */
case 'h':
/** Detect which web server is running */
$web_server = detectHttpd();
if (!is_array($web_server)) {
echo fM("\nCannot find a supported web server - please check the README document for supported web servers. Aborting.\n");
exit(1);
}
/** Add a symlink to the docroot */
$httpdconf = findFile($web_server['file']);
if (!$httpdconf) {
echo fM("\nCannot find " . $web_server['file'] . '. Please enter the full path of ' . $web_server['file'] . ' (/etc/httpd/conf/httpd.conf): ');
$httpdconf = trim(strtolower(fgets(STDIN)));
/** Check if the file exists */
if (!is_file($httpdconf)) {
echo fM(" --> {$httpdconf} does not exist. Aborting.\n");
//.........这里部分代码省略.........
开发者ID:pclemot,项目名称:facileManager,代码行数:101,代码来源:functions.php
示例10: buildZoneConfig
function buildZoneConfig($domain_id)
{
global $fmdb, $__FM_CONFIG, $fm_name;
/** Check domain_id and soa */
$parent_domain_ids = getZoneParentID($domain_id);
if (!isset($parent_domain_ids[2])) {
$query = "SELECT * FROM fm_{$__FM_CONFIG['fmDNS']['prefix']}domains d, fm_{$__FM_CONFIG['fmDNS']['prefix']}soa s WHERE domain_status='active' AND d.account_id='{$_SESSION['user']['account_id']}' AND s.soa_id=d.soa_id AND d.domain_id IN (" . join(',', $parent_domain_ids) . ")";
} else {
$query = "SELECT * FROM fm_{$__FM_CONFIG['fmDNS']['prefix']}domains d, fm_{$__FM_CONFIG['fmDNS']['prefix']}soa s WHERE domain_status='active' AND d.account_id='{$_SESSION['user']['account_id']}' AND\n\t\t\t\ts.soa_id=(SELECT soa_id FROM fm_dns_domains WHERE domain_id={$parent_domain_ids[2]})";
}
$result = $fmdb->query($query);
if (!$fmdb->num_rows) {
return sprintf('<p class="error">%s</p>' . "\n", __('Failed: There was no SOA record found for this zone.'));
}
$domain_details = $fmdb->last_result;
extract(get_object_vars($domain_details[0]), EXTR_SKIP);
$name_servers = $this->getNameServers($domain_name_servers, array('masters'));
/** No name servers so return */
if (!$name_servers) {
return sprintf('<p class="error">%s</p>' . "\n", __('There are no DNS servers hosting this zone.'));
}
/** Loop through name servers */
$name_server_count = $fmdb->num_rows;
$response = '<textarea rows="12" cols="85">';
$failures = false;
for ($i = 0; $i < $name_server_count; $i++) {
switch ($name_servers[$i]->server_update_method) {
case 'cron':
/** Add records to fm_{$__FM_CONFIG['fmDNS']['prefix']}track_reloads */
foreach ($this->getZoneCloneChildren($domain_id) as $child_id) {
$this->addZoneReload($name_servers[$i]->server_serial_no, $child_id);
}
/** Set the server_update_config flag */
setBuildUpdateConfigFlag($name_servers[$i]->server_serial_no, 'yes', 'update');
$response .= '[' . $name_servers[$i]->server_name . '] ' . __('This zone will be updated on the next cron run.') . "\n";
break;
case 'http':
case 'https':
/** Test the port first */
if (!socketTest($name_servers[$i]->server_name, $name_servers[$i]->server_update_port, 10)) {
$response .= '[' . $name_servers[$i]->server_name . '] ' . sprintf(__('Failed: could not access %s (tcp/%d).'), $name_servers[$i]->server_update_method, $name_servers[$i]->server_update_port) . "\n";
$failures = true;
break;
}
/** Remote URL to use */
$url = $name_servers[$i]->server_update_method . '://' . $name_servers[$i]->server_name . ':' . $name_servers[$i]->server_update_port . '/' . $_SESSION['module'] . '/reload.php';
/** Data to post to $url */
$post_data = array('action' => 'reload', 'serial_no' => $name_servers[$i]->server_serial_no, 'domain_id' => $domain_id);
$post_result = unserialize(getPostData($url, $post_data));
if (!is_array($post_result)) {
/** Something went wrong */
return '<div class="error"><p>' . $post_result . '</p></div>' . "\n";
} else {
if (count($post_result) > 1) {
/** Loop through and format the output */
foreach ($post_result as $line) {
$response .= '[' . $name_servers[$i]->server_name . "] {$line}\n";
if (strpos(strtolower($line), 'fail')) {
$failures = true;
}
}
} else {
$response .= "[{$name_servers[$i]->server_name}] " . $post_result[0] . "\n";
if (strpos(strtolower($post_result[0]), 'fail')) {
$failures = true;
}
}
}
/** Set the server_update_config flag */
setBuildUpdateConfigFlag($name_servers[$i]->server_serial_no, 'yes', 'update');
break;
case 'ssh':
/** Test the port first */
if (!socketTest($name_servers[$i]->server_name, $name_servers[$i]->server_update_port, 10)) {
$response .= '[' . $name_servers[$i]->server_name . '] ' . sprintf(__('Failed: could not access %s (tcp/%d).'), $name_servers[$i]->server_update_method, $name_servers[$i]->server_update_port) . "\n";
$failures = true;
break;
}
/** Get SSH key */
$ssh_key = getOption('ssh_key_priv', $_SESSION['user']['account_id']);
if (!$ssh_key) {
return '<p class="error">' . sprintf(__('Failed: SSH key is not <a href="%s">defined</a>.'), getMenuURL(_('Settings'))) . '</p>' . "\n";
}
$temp_ssh_key = sys_get_temp_dir() . '/fm_id_rsa';
if (file_exists($temp_ssh_key)) {
@unlink($temp_ssh_key);
}
if (@file_put_contents($temp_ssh_key, $ssh_key) === false) {
return '<p class="error">' . sprintf(__('Failed: could not load SSH key into %s.'), $temp_ssh_key) . '</p>' . "\n";
}
@chmod($temp_ssh_key, 0400);
$ssh_user = getOption('ssh_user', $_SESSION['user']['account_id']);
if (!$ssh_user) {
return '<p class="error">' . sprintf(__('Failed: SSH user is not <a href="%s">defined</a>.'), getMenuURL(_('Settings'))) . '</p>' . "\n";
}
unset($post_result);
exec(findProgram('ssh') . " -t -i {$temp_ssh_key} -o 'StrictHostKeyChecking no' -p {$name_servers[$i]->server_update_port} -l {$ssh_user} {$name_servers[$i]->server_name} 'sudo php /usr/local/{$fm_name}/{$_SESSION['module']}/dns.php zones id={$domain_id}'", $post_result, $retval);
@unlink($temp_ssh_key);
if (!is_array($post_result)) {
/** Something went wrong */
//.........这里部分代码省略.........
开发者ID:pclemot,项目名称:facileManager,代码行数:101,代码来源:class_zones.php
示例11: versionCheck
function versionCheck($app_version, $serverhost, $compress)
{
$url = $serverhost . '/buildconf';
$data['action'] = 'version_check';
$server_type = detectFirewallType();
$data['server_type'] = $server_type['type'];
$data['server_version'] = $app_version;
$data['compress'] = $compress;
$raw_data = getPostData($url, $data);
$raw_data = $compress ? @unserialize(gzuncompress($raw_data)) : @unserialize($raw_data);
return $raw_data;
}
开发者ID:pclemot,项目名称:facileManager,代码行数:12,代码来源:functions.php
示例12: session_destroy
//kustutame kõik session muutujad ja peatame sessiooni
session_destroy();
header("Location: page/login.php");
}
// kas kustutame
// ?delete=vastav id mida kustutada on aadressi real
if (isset($_GET["delete"])) {
echo "Kustutame id " . $_GET["delete"];
//käivitan funktsiooni, saadan kaasa id!
deleteReview($_GET["delete"]);
}
if (isset($_POST["save"])) {
updatePost($_POST["id"], $_POST["post"]);
}
//käivitan funktsiooni
$array_of_posts = getPostData();
?>
<div>
<br>
<p><a href="data.php" class="btn btn-primary" role="button">Tagasi teemade lehele</a></p>
<body style="background-color:#0074D9">
<h2 style=color:#F8F8FF>Postitused Eesti jalgpallist</h2>
<p><a href="mingiteema.php" class="btn btn-primary" role="button" style="text-align:left;color:#F8F8FF">Loo ise arvustus</a></p>
<style>
.CSSTableGenerator {
开发者ID:raoulkirsima,项目名称:php-ruhmatoo-projekt,代码行数:31,代码来源:eestijalgpall.php
示例13: getPostData
<?php
require_once 'startup.php';
if (getPostData("formId") == "createVersionedProject" && getPostData("projectName") && getPostData("action") == ecgettext("OK")) {
$projectName = getPostData("projectName");
$updateManager = new UpdateManager();
$update = $updateManager->createUpdate("runProcedure");
$update->addItem("projectName", "/plugins/@PLUGIN_KEY@/project");
$update->addItem("procedureName", "CreateProject");
$update->addItem("actualParameter", array("actualParameterName" => "project_name", "value" => $projectName));
$update->addItem("actualParameter", array("actualParameterName" => "project_description", "value" => getPostData("description")));
$update->addItem("actualParameter", array("actualParameterName" => "default_resource", "value" => getPostData("resourceName")));
$update->addItem("actualParameter", array("actualParameterName" => "default_workspace", "value" => getPostData("workspaceName")));
$updateManager->handleUpdates();
$response = $update->getResponse();
$id = $response->get("jobId");
Data::$queries["getJobInfo"] = array("request" => "getJobInfo", "constantArgs" => array("jobId", $id), "result" => "job");
$limit = 10;
$i = 0;
while (1) {
$result = QueryManager::handleQueryNow("getJobInfo");
if ($i == $limit || $result->get("status") == "completed") {
break;
}
sleep(1);
$i++;
}
$jobId = $result->get("jobId");
$jobName = $result->get("jobName");
$status = $result->get("status");
if ($status != "completed") {
开发者ID:remtcs,项目名称:electriccommander,代码行数:31,代码来源:createProject.php
示例14: libxml_use_internal_errors
include_once $base . '/changeRank.php';
include_once $base . '/shout.php';
// Remember to include other functions if you want to use them!
libxml_use_internal_errors(true);
// Hide DOMDocument warnings (though your errors should be turned off anyways)
$group = 18;
// Change this to your group ID
$cookieTime = $base . '/Private/cookieTime.txt';
if (!file_exists($cookieTime)) {
file_put_contents($cookieTime, 0);
}
$cookie = $base . '/Private/cookie';
if (time() - file_get_contents($cookieTime) > 86400) {
login($cookie, 'username', 'password');
file_put_contents($cookieTime, time());
}
$data = getPostData(true);
if (!$data || !array_key_exists('Validate', $data) || $data['Validate'] != $postKey) {
die('FAILURE: Incorrect/missing validation key.');
}
switch ($data['Action']) {
case 'setRank':
list($ranks, $roles) = getRoleSets($group);
echo updateRank($group, $data['Parameter1'], $data['Parameter2'], $cookie, $ranks, $roles, 9, $base . '/Private/gxcsrf.txt');
break;
case 'shout':
echo shout($cookie, $group, $data['Parameter1']);
break;
default:
die('No action!');
}
开发者ID:iKingUltChake,项目名称:testing,代码行数:31,代码来源:receiver.php
示例15: doClientUpgrade
/**
* Upgrades the client sotware
*
* @since 1.1
* @package facileManager
*/
function doClientUpgrade($serial_no)
{
global $fmdb, $__FM_CONFIG, $fm_name;
/** Check permissions */
if (!currentUserCan('manage_servers', $_SESSION['module'])) {
echo buildPopup('header', _('Error'));
printf('<p>%s</p>', _('You do not have permission to manage servers.'));
echo buildPopup('footer', _('OK'), array('cancel_button' => 'cancel'));
exit;
}
/** Process server group */
if ($serial_no[0] == 'g') {
$group_servers = $this->getGroupServers(substr($serial_no, 1));
if (!is_array($group_servers)) {
return $group_servers;
}
$response = null;
foreach ($group_servers as $serial_no) {
if (is_numeric($serial_no)) {
$response .= $this->doClientUpgrade($serial_no) . "\n";
}
}
return $response;
}
/** Check serial number */
basicGet('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'servers', sanitize($serial_no), 'server_', 'server_serial_no');
if (!$fmdb->num_rows) {
return sprintf(_('%d is not a valid serial number.'), $serial_no);
}
$server_details = $fmdb->last_result;
extract(get_object_vars($server_details[0]), EXTR_SKIP);
$response[] = $server_name;
if ($server_installed != 'yes') {
$response[] = ' --> ' . _('Failed: Client is not installed.') . "\n";
}
if (count($response) == 1) {
switch ($server_update_method) {
case 'cron':
/* Servers updated via cron require manual upgrades */
$response[] = ' --> ' . _('This server needs to be upgraded manually with the following command:');
$response[] = " --> sudo php /usr/local/{$fm_name}/{$_SESSION['module']}/\$(ls /usr/local/{$fm_name}/{$_SESSION['module']} | grep php | grep -v functions) upgrade";
addLogEntry(sprintf(_('Upgraded client scripts on %s.'), $server_name));
break;
case 'http':
case 'https':
/** Test the port first */
if (!socketTest($server_name, $server_update_port, 10)) {
$response[] = ' --> ' . sprintf(_('Failed: could not access %s using %s (tcp/%d).'), $server_name, $server_update_method, $server_update_port);
break;
}
/** Remote URL to use */
$url = $server_update_method . '://' . $server_name . ':' . $server_update_port . '/' . $_SESSION['module'] . '/reload.php';
/** Data to post to $url */
$post_data = array('action' => 'upgrade', 'serial_no' => $server_serial_no);
$post_result = @unserialize(getPostData($url, $post_data));
if (!is_array($post_result)) {
/** Something went wrong */
if (empty($post_result)) {
$response[] = ' --> ' . sprintf(_('It appears %s does not have php configured properly within httpd or httpd is not running.'), $server_name);
break;
}
} else {
if (count($post_result) > 1) {
/** Loop through and format the output */
foreach ($post_result as $line) {
if (strlen(trim($line))) {
$response[] = " --> {$line}";
}
}
} else {
$response[] = " --> " . $post_result[0];
}
addLogEntry(sprintf(_('Upgraded client scripts on %s.'), $server_name));
}
break;
case 'ssh':
/** Test the port first */
if (!socketTest($server_name, $server_update_port, 10)) {
$response[] = ' --> ' . sprintf(_('Failed: could not access %s using %s (tcp/%d).'), $server_name, $server_update_method, $server_update_port);
break;
}
/** Get SSH key */
$ssh_key = getOption('ssh_key_priv', $_SESSION['user']['account_id']);
if (!$ssh_key) {
$response[] = ' --> ' . sprintf(_('Failed: SSH key is not %sdefined</a>.'), '<a href="' . getMenuURL(_('General')) . '">');
break;
}
$temp_ssh_key = sys_get_temp_dir() . '/fm_id_rsa';
if (file_exists($temp_ssh_key)) {
@unlink($temp_ssh_key);
}
if (@file_put_contents($temp_ssh_key, $ssh_key) === false) {
$response[] = ' --> ' . sprintf(_('Failed: could not load SSH key into %s.'), $temp_ssh_key);
break;
//.........这里部分代码省略.........
开发者ID:Vringe,项目名称:facileManager,代码行数:101,代码来源:class_servers.php
示例16: session_start
<?php
session_start();
$post = getPostData();
if ($post['password'] && sha1($post['password']) === '6d99318bbf59a79d891709cd691bd31b4f00f894') {
$_SESSION['loggedIn'] = true;
echo 'success';
exit;
}
function getPostData()
{
$data = json_decode(file_get_contents('php://input'), true);
if ($data === null && count($_POST)) {
$data = $_POST;
}
return $data;
}
开发者ID:callmegoon,项目名称:digital-summit-app,代码行数:17,代码来源:login_submit.php
|
请发表评论