/** * Etablissement d'un challenge, sur la base d'un identifiant SSO * * @author Christophe Beyer <*****@*****.**> * @since 2006/12/08 * @param integer $id_sso Id SSO * @return string résultat du challenge. -ERR xxx si erreur, +OK xxx si c'est bon */ public function challenge() { $id_sso = $this->getRequest('id_sso', null); if (!$id_sso) { echo "-ERR ACC: id_sso manquant"; } elseif (!preg_match('/^[0-9]+$/', $id_sso)) { echo "-ERR ACC: id_sso doit être un nombre"; } else { $token = false; $sql = "SELECT login FROM kernel_sso_users WHERE id_sso = {$id_sso}"; $sso = _doQuery($sql); //print_r($sso); if ($sso) { // On efface l'éventuel challenge courant $daoChallenges = CopixDAOFactory::create('sso|sso_challenges'); $daoChallenges->deleteByIdSso($id_sso); // On insère le nouveau challenge $token = randomkeys(CopixConfig::get('sso|in_encrypt_size')); $res = record('kernel_sso_challenges'); $res->id_sso = $id_sso; $res->challenge = $token; $res->date = mktime(); _ioDao('kernel_sso_challenges')->insert($record); //print_r($res); // if ($res->_idResult != 1) { echo "-ERR BDD: Erreur lors de l'enregistrement dans la base de données"; } //Kernel::deb (md5($token.'FobVVbarwb')); //die(); $token = "+OK " . $token; } else { echo "-ERR ACC: id_sso inexistant"; } echo $token; } return new CopixActionReturn(COPIX_AR_NONE, 0); }
public function __construct() { if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) { record(__FUNCTION__, $GLOBALS['HTTP_RAW_POST_DATA']); } $this->IXR_IntrospectionServer(); /* Don't want to support an API that's obsolete 2 times over, don't know if I have to. $this->addCallback( 'blogger.newPost', 'this:blogger_newPost', array('string'), 'Creates a new post, and optionally publishes it.' ); $this->addCallback( 'blogger.editPost', 'this:blogger_editPost', array('boolean'), 'Updates the information about an existing post.' ); $this->addCallback( 'blogger.getRecentPosts', 'this:blogger_getRecentPosts', array('array'), 'Returns a list of the most recent posts in the system.' ); $this->addCallback( 'blogger.getUserInfo', 'this:blogger_getUserInfo', array('struct'), 'Returns information about an author in the system' ); */ $this->addCallback('blogger.deletePost', 'this:blogger_deletePost', array('array', 'string', 'string', 'string', 'string', 'boolean'), 'Deletes a post.'); $this->addCallback('blogger.getUsersBlogs', 'this:blogger_getUsersBlogs', array('array', 'string', 'string', 'string'), 'Returns a list of weblogs to which an author has posting privileges.'); $this->addCallback('metaWeblog.newPost', 'this:metaWeblog_newPost', array('string', 'string', 'string', 'string', 'struct', 'boolean'), 'Creates a new post, and optionally publishes it.'); $this->addCallback('metaWeblog.editPost', 'this:metaWeblog_editPost', array('boolean', 'string', 'string', 'string', 'struct', 'boolean'), 'Updates an existing post.'); $this->addCallback('metaWeblog.getPost', 'this:metaWeblog_getPost', array('struct', 'string', 'string', 'string'), 'Returns information about a specific post.'); $this->addCallback('metaWeblog.getRecentPosts', 'this:metaWeblog_getRecentPosts', array('array', 'string', 'string', 'string', 'int'), 'Returns a list of the most recent posts in the system.'); $this->addCallback('metaWeblog.newMediaObject', 'this:metaWeblog_newMediaObject', array('string', 'string', 'string', 'string', 'struct'), 'Uploads a file to your webserver.'); $this->addCallback('mt.getRecentPostTitles', 'this:mt_getRecentPostTitles', array('array', 'string', 'string', 'string', 'int'), 'Returns a bandwidth-friendly list of the most recent posts in the system.'); $this->addCallback('mt.supportedMethods', 'this:mt_supportedMethods', array('array'), 'Retrieve information about the XML-RPC methods supported by the server.'); $this->addCallback('mt.supportedTextFilters', 'this:mt_supportedTextFilters', array('array'), 'Retrieve information about the text formatting plugins supported by the server.'); $this->addCallback('mt.getTrackbackPings', 'this:mt_getTrackbackPings', array('array', 'string'), ' Retrieve the list of TrackBack pings posted to a particular entry. This could be used to programmatically retrieve the list of pings for a particular entry, then iterate through each of those pings doing the same, until one has built up a graph of the web of entries referencing one another on a particular topic.'); $this->addCallback('mt.publishPost', 'this:mt_publishPost', array('boolean', 'string', 'string', 'string'), 'Publish (rebuild) all of the static files related to an entry from your weblog. Equivalent to saving an entry in the system (but without the ping).'); $this->addCallback('test.isLoggedIn', 'this:isLoggedIn', array('string', 'string', 'string'), 'Returns user status'); $this->addCallback('test.getDate', 'this:getDate', array('string'), 'Returns the current date'); $this->addCallback('test.getTime', 'this:getTime', array('string'), 'Returns the current time'); $this->addCallback('test.helloWorld', 'this:helloWorld', array('string'), 'Returns "Hello World"'); $this->addCallback('test.error', 'this:ooh', array('struct'), 'Triggers an error response'); $this->addCallback('test.multiplied', 'this:times10', array('int', 'struct'), 'Returns X*10, X*100, X*1000'); $this->serve(); }
function _subtree($id, $termType) { global $recordArray; if (!$retXml) { $retXml = new simpleXmlElement("<temp/>"); } $term = thesaurus::get_name($id); // check if entry allready exists if (!$recordArray[$term]) { //------------------------------------------------------------------------------ // extract (BS) from term // and create new terms from BS clauses $uses = extract_pattern($term, "/\\(BS[: ](?<use>.*)\\)/"); if ($uses) { // create common parameters $newArray['input.name'] = "Thesaurus Redaktion"; $newArray['input.date'] = date("Y-m-d", time()); $newArray['input.time'] = date("h:i:s", time()); $newArray['term.type'] = $termType; $newArray['term.status'] = "Verweisungsform"; $newArray['use'] = $term; // $newArray['broader_term'] = thesaurus::get_parent($id); // loop over uses foreach ($uses as $entry) { $newArray['term'] = $entry; extract_pattern($newArray['term'], "/\\(BS[: ](?<use>.*)\\)/"); // echoall(create_record($newArray,$termType)); xml_insert($retXml->record, create_record($newArray, $termType)); } } //------------------------------------------------------------------------------ // insert entry xml_insert($retXml, record($id, $termType)); // register new record $recordArray[$term] = $term; //------------------------------------------------------------------------------ // recursion of children $children = thesaurus::get_child($id); if ($children) { foreach ($children as $entry) { //echoall($entry); // subchildren -> recursion if (count(thesaurus::get_child($entry))) { $subXml = _subtree($entry, $termType); if ($subXml) { xml_insert($retXml, $subXml); } } } } return $retXml; } }
function _moduleContent(&$smarty, $module_name) { global $arrConf; //folder path for custom templates $local_templates_dir = getWebDirModule($module_name); //conexion resource $pDB = new paloDB($arrConf['elastix_dsn']["elastix"]); //user credentials global $arrCredentials; $dsn_agi_manager = getDNSAGIManager(); $action = getAction(); $content = ""; switch ($action) { case "add": $content = form_Recordings($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $arrCredentials); break; case "record": $content = record($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $dsn_agi_manager, $arrCredentials); break; case "hangup": $content = hangup($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $dsn_agi_manager, $arrCredentials); break; case "save": $content = save_recording($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $arrCredentials); break; case "remove": $content = remove_recording($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $arrCredentials); break; case "check_call_status": $content = checkCallStatus("call_status", $smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $dsn_agi_manager, $arrCredentials); break; case "checkName": $content = check_name($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $dsn_agi_manager, $arrCredentials); break; case "download": $content = downloadFile($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $dsn_agi_manager, $arrCredentials); break; default: $content = reportRecording($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $arrCredentials); break; } return $content; }
<?php function record($name, $age) { echo "{$name}" . "{$age}"; } record('sandhya', 21); record('swati', 22); record('sandeep', 23); record('neetu', 23); ?>
include 'config.php'; $config; $configs = preg_split('/[&=]/', $_POST['config']); for ($j = 0; $j < sizeof($configs); $j += 2) { // echo "{$cfg[$i]} {$cfg[$i+1]}\r\n<br />"; // if(strcmp($configs[$j],'browserSet')==0){ $config[$configs[$j]] = $configs[$j + 1]; // } } report(); $dom = new DOMDocument('1.0', 'utf-8'); $testsuites = $dom->appendChild($dom->createElement('testsuites')); $dirName = str_replace('/', '_', "report_{$config['filter']}"); foreach (Config::getBrowserSet($configBrowserSet) as $key => $value) { $file = $dirName . "/{$key}.xml"; if (!file_exists($file)) { echo "wait for report : {$file}\r\n<br />"; return; } // Config::StopOne($key); $xmlDoc = new DOMDocument('1.0', 'utf-8'); $xmlDoc->load($file); $xmlDom = $xmlDoc->documentElement; //echo $xmlDom->nodeName; $testsuites->appendChild($dom->importNode($xmlDom, true)); } $dom->save("report.xml"); $browserNum = count(Config::getBrowserSet($configBrowserSet)); require_once 'record.php'; record(); Config::StopAll();
ini_set('max_execution_time', 120); $img_dir = "wanted/"; $images = scandir($img_dir); $html = ''; $html .= '<div class="main-gallery gallery js-flickity">'; foreach ($images as $img) { if ($img === '.' || $img === '..') { continue; } if (preg_match('/.jpg/', $img) || preg_match('/.png/', $img)) { $info = pathinfo($img); $photoName = basename($img, '.' . $info['extension']); if (!empty($_GET['search'])) { $search = str_replace('"', '', $_GET['search']); $search = strtoupper($search); if ($search == strtoupper($photoName) || in_array($search, record($photoName))) { $html .= '<div class="gallery-cell" style="border: 1px solid #444;">'; $html .= '<a class="fancybox" rel="group" href="' . $img_dir . $img . '">'; $html .= '<img src="' . $img_dir . $img . '" class="img" title="' . $photoName . '" width="512" />'; $html .= '</a>'; $html .= '</div>'; } } if (empty($_GET['search'])) { $html .= '<div class="gallery-cell" style="border: 1px solid #444;">'; $html .= '<a class="fancybox" rel="group" href="' . $img_dir . $img . '">'; $html .= '<img src="' . $img_dir . $img . '" class="img" title="' . $photoName . '" width="512" />'; $html .= '</a>'; $html .= '</div>'; } } else {
<?php // ----------------- // Tutorial 18 - recording audio input // ----------------- answer(); // record a message. Play the beep, caller must speak within 10 seconds. // Allow 7 seconds of silence and up to 60 seconds of recording. $result = record("Hello. Thanks for calling. Leave your message at the beep.", array("beep" => true, "timeout" => 10, "silenceTimeout" => 7, "maxTime" => 60)); if ($result->name == 'record') { // record returns a URI pointing to the recorded audio... _log("result.recordURI = " . $result->recordURI); // we can then use that URI in a say command to play the recorded audio back... say("you said " . $result->recordURI); } hangup();
exit; } $current_GMT_time = get_GMT(time()); $current_GMT_time_string = date("Y-m-d H:i:s", $current_GMT_time); $current_YVR_time = getTimeByCity($current_GMT_time, 'YVR'); $current_YVR_time_string = date("Y-m-d H:i:s", $current_YVR_time); $current_YVR_date = date("Y-m-d", $current_YVR_time); $current_YVR_date_object = new DateTime($current_YVR_date); //update the daily report table first $selectSQL = "SELECT report_date FROM visitor_daily_report ORDER BY report_date DESC LIMIT 0, 1"; $get_date = mysql_query_or_die($selectSQL, $useradmin); if ($row_get_date = mysql_fetch_assoc($get_date)) { $start_date = $row_get_date['report_date']; } $end_date = date('Y-m-d', strtotime('-1 day')); record($start_date, $end_date); //begin to retrieve data. Default:recent 7 days $seven_days_ago = date('Y-m-d', strtotime('-7 days')); ////$current_YVR_date_object->modify('first day of this month')->format('Y-m-d'); //echo $first_this_month; $data_array = get_data($seven_days_ago, $current_YVR_date); $today_visits = get_visits($current_YVR_date); $today_visitor = "<h2>今日访问次数: " . $today_visits . "</h2>"; $today_unique_visits = get_unique_visits($current_YVR_date); $today_visitor .= "<h2>今日访问量: " . $today_unique_visits . "</h2>"; $today_visitor .= "<h2>人均访问次数: " . number_format($today_visits / $today_unique_visits, 3) . "</h2>"; $total_time = get_time($current_YVR_date); $total_time_string = convert_time($total_time); $average_time = ceil($total_time / $today_visits); $average_time_string = convert_time($average_time); $average_time_per_visit = ceil($total_time / $today_unique_visits);
// $Author: waldb $ include "lib/functions.php"; print_header_open(); $show_station = getstation($station); print_title("Program Listing for {$show_station}"); print_header_close(); if (isset($RECORD)) { if (isset($FLAG)) { record($RECORD, $FLAG); } else { record($RECORD, 0); // function in functions.php } } if (isset($FORCERECORD)) { record($FORCERECORD, 2); } if (isset($DERECORD)) { derecord($DERECORD); } ?> <center> <table border=1><tr bgcolor="#006666"><td><center> <font color="#FFFFFF">Program Listing for <?php //$station = getstation($station); if (!$station) { $station = "(undefined station)"; } echo $show_station;
<?php // An array of phone numbers that are part of the phone tree. $members = array('2125551212', '4155551313'); if (!in_array($currentCall->callerID, $members)) { // The caller isn't a member of the phone tree. say('Sorry, only members of the group can send to this group.'); hangup(); } $done = FALSE; while ($done == FALSE) { $recording = record('Reecord your message at the tone. Press pound when finished.', array('terminator' => '#')); // reset selection to 1 since this is a new recording. $selection = 1; while ($selection == 1) { $choice = ask('To listen to your message, press 1. To re reecord your message, press 2. To send your message, press 3.', array('choices' => '1,2,3', 'mode' => 'dtmf')); $selection = $choice->value; if ($selection == 1) { // Play the message, then reprompt. say($recording->value); } elseif ($selection == 3) { // Break out of the recording loop. $done = TRUE; continue 2; } // Pause a moment before replaying the prompt. sleep(1); } } // If we've gotten here, then it's time to send the message. say("Sending your message now. Please wait.");
// 空闲状态 if ($data['status'] == 'idle') { // 执行增量 $params = http_build_query($solrDelta); $deltaUrl = $url . '?' . $params; $delta = solr_curl($deltaUrl, $config['auth']); if ($delta['httpcode'] == 200) { record("SUCESS: solr core({$core}) delta-import"); } else { record("ERROR: query delta-import failed! httpcode: " . $delta['httpcode']); } } else { record("ERROR: solr core({$core}) is " . $data['status']); } } else { record("ERROR: query status failed! httpcode: " . $status['httpcode']); } } function solr_curl($url, $auth, $timeout = 10) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD, $auth); $data = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); return array('httpcode' => $httpcode, 'data' => $data);
function sendVitality($user, $session, $badges) { //echo "session"; //print_r($session); $badge_names = array("agg.twitter" => "Tweetoo", "avatars" => "Beharupia", "buzz" => "Buzzooka", "y.mybloglog" => "BloggY!", "socialite" => "Socialite", "newbie1" => "Newbie"); $badge_desc = array("agg.twitter" => "You've shared 5 twitter updates!", "avatars" => "You've created a Yahoo! avatar", "buzz" => "You've buzed up 3 times", "y.mybloglog" => "You've shared 10 blog updates", "socialite" => "You've updates from 8 different sources", "newbie1" => "Congrats! On sharing your updates"); foreach ($badges as $source => $count) { $mem_key = "{$user->guid}:{$source}"; if (!record($user->guid, $source)) { continue; } $title = "just unlocked the badge " . $badge_names[$source] . " on Updatesville"; $description = $badge_desc[$source]; $imgURL = "http://hacks.saurabhsahni.com/updatesville/icons/{$source}.png"; $imgWidth = "64"; $imgHeight = "67"; $iconURL = "http://hacks.saurabhsahni.com/updatesville/vitality_bigger2.gif"; $link = "http://pulse.yahoo.com/y/apps/7BNRkt42/"; // $updatesQuery = "INSERT INTO social.updates(guid,title,description,imgURL,imgWidth,imgHeight,iconURL,link) values ('{$user->guid}','$title','$description','$imgURL','$imgWidth','$imgHeight','$iconURL','$link')"; // error_log($updatesQuery); // $updates = $session->query($updatesQuery); $updates = $user->insertUpdate(md5($source), $title, $link, $description, $imgURL, $imgWidth, $imgHeight, $iconURL, time()); mem_set($mem_key, "1"); // echo $updatesQuery; // print_r($updates); // error_log(print_r($updates,true)); } }
print "<h1>" . htmlentities($msg['acquisition_ach_ges'], ENT_QUOTES, $charset) . " : " . htmlentities($msg['acquisition_menu_ach_recept'], ENT_QUOTES, $charset) . "</h1>"; switch ($action) { case 'apply_changes': apply_changes(); show_list_recept(); break; case 'do_relances': if (count($chk)) { do_relances(); } show_list_recept(); break; case 'from_cde': if ($id_cde) { show_from_cde(); } show_list_recept(); break; case 'catalog': catalog(); break; case 'record': if (record()) { show_list_recept(); } break; case 'list': default: show_list_recept(); break; }
//sendno 发送序号。接口调用时指定的。 //errcode 错误码。参考:错误码定义 //errmsg 错误说明 //total_user 本次推送满足条件的用户数 //send_cnt 本次推送当前在线用户数 include 'config.inc.php'; include 'db.class.php'; $ret = $_REQUEST['push_result']; //print_r($_REQUEST); $ret = stripslashes($ret); //去掉转义符 $res = json_decode($ret, true); $result = array(); $res['app_keys'] = "1dad03ee5308c4eed680e920"; // 目前官方没有提供push_result[app_keys],所以先自己写一个,可以先把数据写到一个表里去, //后面等官方提供了这个参数,就注释掉,则根据这个app_keys来判断是那个app的返回信息。 if ($res['app_keys'] == appkeys) { dataConnect(); $sql = "UPDATE `" . DB_TAB . "` SET `total_user` = '" . $res['total_user'] . "', `send_cnt` = '" . $res['send_cnt'] . "' WHERE `sendno` = " . $res['sendno'] . ""; echo "{$sql}"; $query = mysql_query($sql); //print_r($query); } record($ret); function record($con) { $con .= ' ' . date('Y-m-d H:i:s', time()) . "\r\n"; $handler = fopen('log.txt', 'a'); fwrite($handler, $con); fclose($handler); }