Exemplo n.º 1
1
 public function checkContentDuration($id)
 {
     $path = "/var/www/html/ediacademy/mediagg/contenuti/{$id}/{$id}.mp4";
     $getID3 = new getID3();
     $file = $getID3->analyze($path);
     FB::log($file);
     return (int) $file['playtime_seconds'];
 }
Exemplo n.º 2
0
 function fb_exit()
 {
     global $wp_version, $wp_roles, $wp_constants, $wp_globals_a_l, $wp_globals_m_r, $wp_globals_s_v, $wp_globals_w, $data, $update_options;
     if (!class_exists('FB')) {
         require_once 'FirePHPCore/fb.php';
     }
     $firephp = FirePHP::getInstance(TRUE);
     $wp_constants = array('ABSPATH' => ABSPATH, 'ADMIN_COOKIE_PATH' => ADMIN_COOKIE_PATH, 'APP_REQUEST' => APP_REQUEST, 'ARRAY_A' => ARRAY_A, 'ARRAY_N' => ARRAY_N, 'ATOM' => ATOM, 'AUTH_COOKIE' => AUTH_COOKIE, 'AUTH_KEY' => AUTH_KEY, 'AUTOSAVE_INTERVAL' => AUTOSAVE_INTERVAL, 'COMMENTS_TEMPLATE' => COMMENTS_TEMPLATE, 'COOKIEHASH' => COOKIEHASH, 'COOKIEPATH' => COOKIEPATH, 'COOKIE_DOMAIN' => COOKIE_DOMAIN, 'CRLF' => CRLF, 'CUSTOM_TAGS' => CUSTOM_TAGS, 'DB_CHARSET' => DB_CHARSET, 'DB_COLLATE' => DB_COLLATE, 'DB_HOST' => DB_HOST, 'DB_NAME' => DB_NAME, 'DB_PASSW' => DB_PASSW, 'DB_PASSWORD' => DB_PASSWORD, 'DB_USER' => DB_USER, 'DOING_AJAX' => DOING_AJAX, 'DOING_AUTOSAVE' => DOING_AUTOSAVE, 'DOING_CRON' => DOING_CRON, 'EP_ALL' => EP_ALL, 'EP_ATTACHMENT' => EP_ATTACHMENT, 'EP_AUTHORS' => EP_AUTHORS, 'EP_CATEGORIES' => EP_CATEGORIES, 'EP_COMMENTS' => EP_COMMENTS, 'EP_DATE' => EP_DATE, 'EP_DAY' => EP_DAY, 'EP_MONTH' => EP_MONTH, 'EP_NONE' => EP_NONE, 'EP_PAGES' => EP_PAGES, 'EP_PERMALINK' => EP_PERMALINK, 'EP_ROOT' => EP_ROOT, 'EP_SEARCH' => EP_SEARCH, 'EP_TAGS' => EP_TAGS, 'EP_YEAR' => EP_YEAR, 'EZSQL_VERSION' => EZSQL_VERSION, 'FORCE_SSL_ADMIN' => FORCE_SSL_ADMIN, 'FORCE_SSL_LOGIN' => FORCE_SSL_LOGIN, 'FTP_ASCII' => FTP_ASCII, 'FTP_AUTOASCII' => FTP_AUTOASCII, 'FTP_BINARY' => FTP_BINARY, 'FTP_FORCE' => FTP_FORCE, 'IS_PROFILE_PAGE' => IS_PROFILE_PAGE, 'JSON_BOOL' => JSON_BOOL, 'JSON_END_ARRAY' => JSON_END_ARRAY, 'JSON_END_OBJ' => JSON_END_OBJ, 'JSON_FLOAT' => JSON_FLOAT, 'JSON_INT' => JSON_INT, 'JSON_IN_ARRAY' => JSON_IN_ARRAY, 'JSON_IN_BETWEEN' => JSON_IN_BETWEEN, 'JSON_IN_OBJECT' => JSON_IN_OBJECT, 'JSON_KEY' => JSON_KEY, 'JSON_NULL' => JSON_NULL, 'JSON_SKIP' => JSON_SKIP, 'JSON_START_ARRAY' => JSON_START_ARRAY, 'JSON_START_OBJ' => JSON_START_OBJ, 'JSON_STR' => JSON_STR, 'LANGDIR' => LANGDIR, 'LOGGED_IN_COOKIE' => LOGGED_IN_COOKIE, 'LOGGED_IN_KEY' => LOGGED_IN_KEY, 'MAGPIE_CACHE_AGE' => MAGPIE_CACHE_AGE, 'MAGPIE_CACHE_DIR' => MAGPIE_CACHE_DIR, 'MAGPIE_CACHE_FRESH_ONLY' => MAGPIE_CACHE_FRESH_ONLY, 'MAGPIE_CACHE_ON' => MAGPIE_CACHE_ON, 'MAGPIE_DEBUG' => MAGPIE_DEBUG, 'MAGPIE_FETCH_TIME_OUT' => MAGPIE_FETCH_TIME_OUT, 'MAGPIE_INITALIZED' => MAGPIE_INITALIZED, 'MAGPIE_USER_AGENT' => MAGPIE_USER_AGENT, 'MAGPIE_USE_GZIP' => MAGPIE_USE_GZIP, 'MAX_EXECUTION_TIME' => MAX_EXECUTION_TIME, 'MAX_RESULTS' => MAX_RESULTS, 'MC_LOGGER_DEBUG' => MC_LOGGER_DEBUG, 'MC_LOGGER_ERROR' => MC_LOGGER_ERROR, 'MC_LOGGER_FATAL' => MC_LOGGER_FATAL, 'MC_LOGGER_INFO' => MC_LOGGER_INFO, 'MC_LOGGER_WARN' => MC_LOGGER_WARN, 'OBJECT' => OBJECT, 'OBJECT_K' => OBJECT_K, 'PASS_COOKIE' => PASS_COOKIE, 'PCLZIP_ATT_FILE_NAME' => PCLZIP_ATT_FILE_NAME, 'PCLZIP_ATT_FILE_NEW_FULL_NAME' => PCLZIP_ATT_FILE_NEW_FULL_NAME, 'PCLZIP_ATT_FILE_NEW_SHORT_NAME' => PCLZIP_ATT_FILE_NEW_SHORT_NAME, 'PCLZIP_CB_POST_ADD' => PCLZIP_CB_POST_ADD, 'PCLZIP_CB_POST_DELETE' => PCLZIP_CB_POST_DELETE, 'PCLZIP_CB_POST_EXTRACT' => PCLZIP_CB_POST_EXTRACT, 'PCLZIP_CB_POST_LIST' => PCLZIP_CB_POST_LIST, 'PCLZIP_CB_PRE_ADD' => PCLZIP_CB_PRE_ADD, 'PCLZIP_CB_PRE_DELETE' => PCLZIP_CB_PRE_DELETE, 'PCLZIP_CB_PRE_EXTRACT' => PCLZIP_CB_PRE_EXTRACT, 'PCLZIP_CB_PRE_LIST' => PCLZIP_CB_PRE_LIST, 'PCLZIP_ERROR_EXTERNAL' => PCLZIP_ERROR_EXTERNAL, 'PCLZIP_ERR_ALREADY_A_DIRECTORY' => PCLZIP_ERR_ALREADY_A_DIRECTORY, 'PCLZIP_ERR_BAD_CHECKSUM' => PCLZIP_ERR_BAD_CHECKSUM, 'PCLZIP_ERR_BAD_EXTENSION' => PCLZIP_ERR_BAD_EXTENSION, 'PCLZIP_ERR_BAD_EXTRACTED_FILE' => PCLZIP_ERR_BAD_EXTRACTED_FILE, 'PCLZIP_ERR_BAD_FORMAT' => PCLZIP_ERR_BAD_FORMAT, 'PCLZIP_ERR_DELETE_FILE_FAIL' => PCLZIP_ERR_DELETE_FILE_FAIL, 'PCLZIP_ERR_DIRECTORY_RESTRICTION' => PCLZIP_ERR_DIRECTORY_RESTRICTION, 'PCLZIP_ERR_DIR_CREATE_FAIL' => PCLZIP_ERR_DIR_CREATE_FAIL, 'PCLZIP_ERR_FILENAME_TOO_LONG' => PCLZIP_ERR_FILENAME_TOO_LONG, 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP' => PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE' => PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, 'PCLZIP_ERR_INVALID_OPTION_VALUE' => PCLZIP_ERR_INVALID_OPTION_VALUE, 'PCLZIP_ERR_INVALID_PARAMETER' => PCLZIP_ERR_INVALID_PARAMETER, 'PCLZIP_ERR_INVALID_ZIP' => PCLZIP_ERR_INVALID_ZIP, 'PCLZIP_ERR_MISSING_FILE' => PCLZIP_ERR_MISSING_FILE, 'PCLZIP_ERR_MISSING_OPTION_VALUE' => PCLZIP_ERR_MISSING_OPTION_VALUE, 'PCLZIP_ERR_NO_ERROR' => PCLZIP_ERR_NO_ERROR, 'PCLZIP_ERR_READ_OPEN_FAIL' => PCLZIP_ERR_READ_OPEN_FAIL, 'PCLZIP_ERR_RENAME_FILE_FAIL' => PCLZIP_ERR_RENAME_FILE_FAIL, 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION' => PCLZIP_ERR_UNSUPPORTED_COMPRESSION, 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' => PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'PCLZIP_ERR_USER_ABORTED' => PCLZIP_ERR_USER_ABORTED, 'PCLZIP_ERR_WRITE_OPEN_FAIL' => PCLZIP_ERR_WRITE_OPEN_FAIL, 'PCLZIP_OPT_ADD_COMMENT' => PCLZIP_OPT_ADD_COMMENT, 'PCLZIP_OPT_ADD_PATH' => PCLZIP_OPT_ADD_PATH, 'PCLZIP_OPT_BY_EREG' => PCLZIP_OPT_BY_EREG, 'PCLZIP_OPT_BY_INDEX' => PCLZIP_OPT_BY_INDEX, 'PCLZIP_OPT_BY_NAME' => PCLZIP_OPT_BY_NAME, 'PCLZIP_OPT_BY_PREG' => PCLZIP_OPT_BY_PREG, 'PCLZIP_OPT_COMMENT' => PCLZIP_OPT_COMMENT, 'PCLZIP_OPT_EXTRACT_AS_STRING' => PCLZIP_OPT_EXTRACT_AS_STRING, 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION' => PCLZIP_OPT_EXTRACT_DIR_RESTRICTION, 'PCLZIP_OPT_EXTRACT_IN_OUTPUT' => PCLZIP_OPT_EXTRACT_IN_OUTPUT, 'PCLZIP_OPT_NO_COMPRESSION' => PCLZIP_OPT_NO_COMPRESSION, 'PCLZIP_OPT_PATH' => PCLZIP_OPT_PATH, 'PCLZIP_OPT_PREPEND_COMMENT' => PCLZIP_OPT_PREPEND_COMMENT, 'PCLZIP_OPT_REMOVE_ALL_PATH' => PCLZIP_OPT_REMOVE_ALL_PATH, 'PCLZIP_OPT_REMOVE_PATH' => PCLZIP_OPT_REMOVE_PATH, 'PCLZIP_OPT_REPLACE_NEWER' => PCLZIP_OPT_REPLACE_NEWER, 'PCLZIP_OPT_SET_CHMOD' => PCLZIP_OPT_SET_CHMOD, 'PCLZIP_OPT_STOP_ON_ERROR' => PCLZIP_OPT_STOP_ON_ERROR, 'PCLZIP_READ_BLOCK_SIZE' => PCLZIP_READ_BLOCK_SIZE, 'PCLZIP_SEPARATOR' => PCLZIP_SEPARATOR, 'PCLZIP_TEMPORARY_DIR' => PCLZIP_TEMPORARY_DIR, 'PLUGINDIR' => PLUGINDIR, 'PLUGINS_COOKIE_PATH' => PLUGINS_COOKIE_PATH, 'RSS' => RSS, 'SECURE_AUTH_COOKIE' => SECURE_AUTH_COOKIE, 'SECURE_AUTH_KEY' => SECURE_AUTH_KEY, 'SITECOOKIEPATH' => SITECOOKIEPATH, 'STATUS_INTERVAL' => STATUS_INTERVAL, 'STYLESHEETPATH' => STYLESHEETPATH, 'TEMPLATEPATH' => TEMPLATEPATH, 'TEST_COOKIE' => TEST_COOKIE, 'USER_COOKIE' => USER_COOKIE, 'WPINC' => WPINC, 'WPLANG' => WPLANG, 'WP_ADMIN' => WP_ADMIN, 'WP_CONTENT_DIR' => WP_CONTENT_DIR, 'WP_CONTENT_URL' => WP_CONTENT_URL, 'WP_IMPORTING' => WP_IMPORTING, 'WP_INSTALLING' => WP_INSTALLING, 'WP_LANG_DIR' => WP_LANG_DIR, 'WP_MEMORY_LIMIT' => WP_MEMORY_LIMIT, 'WP_PLUGIN_DIR' => WP_PLUGIN_DIR, 'WP_PLUGIN_URL' => WP_PLUGIN_URL, 'WP_USE_THEMES' => WP_USE_THEMES, 'WXR_VERSION' => WXR_VERSION, 'XMLRPC_REQUEST' => XMLRPC_REQUEST);
     $wp_globals_a_l = array('$admin_page_hooks' => $admin_page_hooks, '$ajax_results' => $ajax_results, '$all_links' => $all_links, '$allowedposttags' => $allowedposttags, '$allowedtags' => $allowedtags, '$authordata' => $authordata, '$bgcolor' => $bgcolor, '$cache_categories' => $cache_categories, '$cache_lastcommentmodified' => $cache_lastcommentmodified, '$cache_lastpostdate' => $cache_lastpostdate, '$cache_lastpostmodified' => $cache_lastpostmodified, '$cache_userdata' => $cache_userdata, '$category_cache' => $category_cache, '$class' => $class, '$comment' => $comment, '$comment_cache' => $comment_cache, '$comment_count_cache' => $comment_count_cache, '$commentdata' => $commentdata, '$current_user' => $current_user, '$day' => $day, '$debug' => $debug, '$descriptions' => $descriptions, '$error' => $error, '$feeds' => $feeds, '$id' => $id, '$is_apache' => $is_apache, '$is_IIS' => $is_IIS, '$is_macIE' => $is_macIE, '$is_winIE' => $is_winIE, '$l10n' => $l10n, '$locale' => $locale, '$link' => $link);
     $wp_globals_m_r = array('$m' => $m, '$map' => $map, '$max_num_pages' => $max_num_pages, '$menu' => $menu, '$mode' => $mode, '$month' => $month, '$month_abbrev' => $month_abbrev, '$monthnum' => $monthnum, '$more' => $more, '$multipage' => $multipage, '$names' => $names, '$newday' => $newday, '$numpages' => $numpages, '$page' => $page, '$page_cache' => $page_cache, '$paged' => $paged, '$pagenow' => $pagenow, '$pages' => $pages, '$parent_file' => $parent_file, '$preview' => $preview, '$previousday' => $previousday, '$previousweekday' => $previousweekday, '$plugin_page' => $plugin_page, '$post' => $post, '$post_cache' => $post_cache, '$post_default_category' => $post_default_category, '$post_default_title' => $post_default_title, '$post_meta_cache' => $post_meta_cache, '$postc' => $postc, '$postdata' => $postdata, '$posts' => $posts, '$posts_per_page' => $posts_per_page, '$previousday' => $previousday, '$request' => $request, '$result' => $result, '$richedit' => $richedit);
     $wp_globals_s_v = array('$single' => $single, '$submenu' => $submenu, '$table_prefix' => $table_prefix, '$targets' => $targets, '$timedifference' => $timedifference, '$timestart' => $timestart, '$timeend' => $timeend, '$updated_timestamp' => $updated_timestamp, '$urls' => $urls, '$user_ID' => $user_ID, '$user_email' => $user_email, '$user_identity' => $user_identity, '$user_level' => $user_level, '$user_login' => $user_login, '$user_pass_md5' => $user_pass_md5, '$user_url' => $user_url);
     $wp_globals_w = array('$weekday' => $weekday, '$weekday_abbrev' => $weekday_abbrev, '$weekday_initial' => $weekday_initial, '$withcomments' => $withcomments, '$wp' => $wp, '$wp_broken_themes' => $wp_broken_themes, '$wp_db_version' => $wp_db_version, '$wp_did_header' => $wp_did_header, '$wp_did_template_redirect' => $wp_did_template_redirect, '$wp_file_description' => $wp_file_description, '$wp_filter' => $wp_filter, '$wp_importers' => $wp_importers, '$wp_plugins' => $wp_plugins, '$wp_themes' => $wp_themes, '$wp_object_cache' => $wp_object_cache, '$wp_query' => $wp_query, '$wp_queries' => $wp_queries, '$wp_rewrite' => $wp_rewrite, '$wp_roles' => $wp_roles, '$wp_similiesreplace' => $wp_similiesreplace, '$wp_smiliessearch' => $wp_smiliessearch, '$wp_version' => $wp_version, '$wpcommentspopupfile' => $wpcommentspopupfile, '$wpcommentsjavascript' => $wpcommentsjavascript);
     FB::info($wp_version, 'WP Version');
     //			FB::info($wp_roles, 'WP Roles');
     //			FB::info($wp_constants, 'WP Constant');
     //			FB::info($wp_globals_a_l, 'WP Globals A-L');
     //			FB::info($wp_globals_m_r, 'WP Globals M-R');
     //			FB::info($wp_globals_s_v, 'WP Globals S-V');
     //			FB::info($wp_globals_w, 'WP Globals W');
     //			FB::info($data, 'WP DATA');
     //			FB::info($update_options, 'Update Array');
     //PHP Predefined Variables
     FB::info($_COOKIE, '_COOKIE');
     FB::info($_ENV, '_ENV');
     FB::info($_FILES, '_FILES');
     FB::info($_GET, '_GET');
     FB::info($PHP_SELF, '_PHP_SELF');
     FB::info($_POST, '_POST');
     FB::info($_REQUEST, '_REQUEST');
     FB::info($_SERVER, '_SERVER');
     FB::info($_SESSION, '_SESSION');
 }
Exemplo n.º 3
0
 public function generateJsonResponse($action, $do, $data)
 {
     $response = '';
     if (JDEBUG == 1 && defined('JFIREPHP')) {
         FB::log("Kunena JSON action: " . $action);
     }
     // Sanitize $data variable
     $data = $this->_db->getEscaped($data);
     if ($this->_my->id) {
         // We only entertain json requests for registered and logged in users
         switch ($action) {
             case 'autocomplete':
                 $response = $this->_getAutoComplete($do, $data);
                 break;
             case 'preview':
                 $body = JRequest::getVar('body', '', 'post', 'string', JREQUEST_ALLOWRAW);
                 $response = $this->_getPreview($body);
                 break;
             case 'pollcatsallowed':
                 // TODO: deprecated
                 $response = $this->_getPollsCatsAllowed();
                 break;
             case 'pollvote':
                 $vote = JRequest::getInt('kpollradio', '');
                 $id = JRequest::getInt('kpoll-id', 0);
                 if (!JRequest::checkToken()) {
                     return false;
                 }
                 $response = $this->_addPollVote($vote, $id, $this->_my->id);
                 break;
             case 'pollchangevote':
                 $vote = JRequest::getInt('kpollradio', '');
                 $id = JRequest::getInt('kpoll-id', 0);
                 if (!JRequest::checkToken()) {
                     return false;
                 }
                 $response = $this->_changePollVote($vote, $id, $this->_my->id);
                 break;
             case 'anynomousallowed':
                 // TODO: deprecated
                 $response = $this->_anynomousAllowed();
                 break;
             case 'uploadfile':
                 $response = $this->_uploadFile($do);
                 break;
             case 'modtopiclist':
                 $response = $this->_modTopicList($data);
                 break;
             case 'removeattachment':
                 $response = $this->_removeAttachment($data);
                 break;
             default:
                 break;
         }
     } else {
         $response = array('status' => '-1', 'error' => JText::_('COM_KUNENA_AJAX_PERMISSION_DENIED'));
     }
     // Output the JSON data.
     return json_encode($response);
 }
Exemplo n.º 4
0
 public function initFirePHP()
 {
     // 开启FirePHP调试或者关闭
     $options = array('maxObjectDepth' => 10, 'maxArrayDepth' => 10, 'maxDepth' => 10, 'useNativeJsonEncode' => true, 'includeLineNumbers' => true);
     \FirePHP::getInstance(true)->setEnabled(true);
     \FB::setOptions($options);
 }
Exemplo n.º 5
0
function passwordExists($dbConn, $username, $password)
{
    $isValid = false;
    $dbQuery = "SELECT Password FROM USERS WHERE Username = '******' LIMIT 1";
    FB::info('passwordExists() query: ' . $dbQuery);
    $dbRows = mysqli_query($dbConn, $dbQuery);
    $dbValues = mysqli_fetch_assoc($dbRows);
    $dbPassword = $dbValues['Password'];
    if (password_verify($password, $dbPassword)) {
        $isValid = true;
        FB::log('Password is valid!');
        // Check if the password needs a rehash.
        if (password_needs_rehash($dbPassword, PASSWORD_DEFAULT)) {
            FB::log('Rehashing password!');
            $dbPassword = password_hash($password, PASSWORD_DEFAULT);
            $dbQuery = "UPDATE USERS SET Password = '******' WHERE Username = '******'";
            FB::info('Password rehash query: ' . $dbQuery);
            $dbRows = mysqli_query($dbConn, $dbQuery);
            if ($dbRows) {
                FB::log('Password rehash successful!');
            } else {
                FB::error('Password rehash failed: ' . mysqli_error($dbConn));
            }
        }
    }
    return $isValid;
}
Exemplo n.º 6
0
 function display($tpl = null)
 {
     $this->items = $this->get('Items');
     $this->pagination = $this->get('Pagination');
     $this->state = $this->get('State');
     FB::log($this->items);
     $document =& JFactory::getDocument();
     JHtml::_('bootstrap.framework');
     //RS
     JHtml::_('jquery.framework');
     //RS
     JHtml::_('jquery.ui', array('core', 'sortable'));
     //RS
     $document->addStyleSheet('http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css');
     //      Following variables used more than once
     //      $this->sortColumn = $this->state->get('list.ordering');
     //      $this->sortDirection = $this->state->get('list.direction');
     //        $this->searchterms = $this->state->get('filter.search');
     // Set the toolbar
     $this->addToolBar();
     // Set the document
     $this->setDocument();
     // Display the template
     parent::display($tpl);
 }
Exemplo n.º 7
0
 function index()
 {
     $all = $this->equipment->getAll();
     FB::error($all);
     $this->set('equipment', $all);
     FB::error($this->equipment);
 }
Exemplo n.º 8
0
 public static function getInstance($arg)
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self($arg);
     }
     return self::$instance;
 }
Exemplo n.º 9
0
 public function __construct()
 {
     if (!self::$Facebook) {
         FacebookInfo::getConfig();
         self::$Facebook = new Facebook(FacebookInfo::$configs);
     }
 }
Exemplo n.º 10
0
function NewDocRequest($order_id)
{
    global $customer_id, $abo_id;
    FB::info('NewDocRequest Nummer' . $abo_id);
    if (SOAP_SERVER != '') {
        $client = new SoapClient(null, array('location' => SOAP_SERVER, 'uri' => SOAP_NAMESPACE, 'trace' => true, 'connection_timeout' => 5));
        $response = $client->__doRequest('<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
		  <SOAP-ENV:Body>
			<NewDocRequest xmlns="test">
				<Nummer>' . $abo_id . '</Nummer>
				<Soort>B</Soort>
				<Weborder>' . $order_id . '</Weborder>
			</NewDocRequest>
		  </SOAP-ENV:Body>
		</SOAP-ENV:Envelope>', SOAP_SERVER, SOAP_NAMESPACE, SOAP_1_2);
        if ($response) {
            $dom = new DOMDocument();
            $dom->loadXML($response);
            $xPath = new DOMXPath($dom);
            $result = array();
            if ($xPath->evaluate("//Status")->item(0)->nodeValue == 0) {
                $result = $xPath->evaluate("//StatusTekst")->item(0)->nodeValue;
            } else {
                $result = $xPath->evaluate("//Document")->item(0)->nodeValue;
            }
        }
    }
    return $result;
}
Exemplo n.º 11
0
function addUser($dbConn, $username, $password, $email)
{
    // Add user to USERS table.
    $dbQuery = "INSERT INTO USERS(Username, First_name, Last_name, Email, Status, About, Date_joined, Password) " . "VALUES('" . $username . "', '', '', '" . $email . "', 'active', '', CURDATE(), '" . $password . "')";
    FB::info('addUser() query:' . $dbQuery);
    if ($dbResults = mysqli_query($dbConn, $dbQuery)) {
        FB::log('USERS insert success! (I think)');
    } else {
        FB::error('USERS insert failed!');
    }
    $userId = mysqli_insert_id($dbConn);
    // ID of the latest created user.
    FB::info('New User ID: ' . $userId);
    // Add user role for newly created user into USER_ROLES table.
    $dbQuery = "INSERT INTO USER_ROLES(User_Id, Role_Id)" . "VALUES(" . $userId . ", 1)";
    if ($dbResults = mysqli_query($dbConn, $dbQuery)) {
        FB::log('USER_ROLES insert success! (I think)');
    } else {
        FB::error('USER_ROLES insert failed!');
    }
    // Add default avatar for newly created user into IMAGES table.
    $avatar = file('images/default_avatar.png');
    // Default avatar for new users.
    $dbQuery = "INSERT INTO IMAGES(Description, Image, User_Id) " . "VALUES('test', '" . $avatar . "', " . $userId . ")";
    if ($dbResults = mysqli_query($dbConn, $dbQuery)) {
        FB::log('IMAGES insert success! (I think)');
    } else {
        FB::error('IMAGES insert failed!');
    }
}
Exemplo n.º 12
0
 /**
  * The second last process, should only be getting everything
  * syntaxically correct, rather than doing any heavy processing
  *
  * @author Anthony Short
  * @return $css string
  */
 public static function post_process()
 {
     if ($found = CSS::find_properties_with_value('image-replace', 'url\\([\'\\"]?([^)]+)[\'\\"]?\\)')) {
         foreach ($found[4] as $key => $value) {
             $path = $url = str_replace("\\", "/", unquote($value));
             # If they're getting an absolute file
             if ($path[0] == "/") {
                 $path = DOCROOT . ltrim($path, "/");
             }
             # Check if it exists
             if (!file_exists($path)) {
                 FB::log("ImageReplace - Image doesn't exist " . $path);
             }
             # Make sure it's an image
             if (!is_image($path)) {
                 FB::log("ImageReplace - File is not an image: {$path}");
             }
             // Get the size of the image file
             $size = GetImageSize($path);
             $width = $size[0];
             $height = $size[1];
             // Make sure theres a value so it doesn't break the css
             if (!$width && !$height) {
                 $width = $height = 0;
             }
             // Build the selector
             $properties = "\n\t\t\t\t\tbackground:url({$url}) no-repeat 0 0;\n\t\t\t\t\theight:{$height}px;\n\t\t\t\t\twidth:{$width}px;\n\t\t\t\t\tdisplay:block;\n\t\t\t\t\ttext-indent:-9999px;\n\t\t\t\t\toverflow:hidden;\n\t\t\t\t";
             CSS::replace($found[2][$key], $properties);
         }
         # Remove any left overs
         CSS::replace($found[1], '');
     }
 }
Exemplo n.º 13
0
 public function iniciarFacebook()
 {
     $this->render(null, null);
     Load::lib("facebook");
     $facebook = new FB("fb/iniciarFacebook");
     if (!$facebook->iniciado()) {
         $facebook->iniciar();
     } else {
         $usuario = $facebook->iniciar();
         print_r($usuario);
     }
     if (UsuarioLogin::existe("facebook_id=" . $usuario->id)) {
         $usuario = UsuarioLogin::consultar("facebook_id=" . $usuario->id);
     } else {
         $usuario = UsuarioLogin::registrarFacebook($user->id, utf8_decode($user->first_name), utf8_decode($user->last_name), formatoFechaDBGringa($user->birthday), $user->gender, $user->email, $user->link);
     }
 }
Exemplo n.º 14
0
 public function handle()
 {
     $page = htmlspecialchars(@$_GET['page']);
     FB::log($page);
     $page = $this->getPageIfEmpty($page);
     $view = $this->pageData($page);
     $this->render($view);
 }
Exemplo n.º 15
0
 public static function fire($value)
 {
     $dbgs = array_shift(debug_backtrace());
     $msg = date('[ Y-m-d H:i:s ]' . "\n");
     $msg .= 'file: ' . $dbgs['file'] . "\n";
     $msg .= 'line: ' . $dbgs['line'] . "\n\n";
     FB::warn($msg);
     FB::error($value);
 }
Exemplo n.º 16
0
Arquivo: FB.php Projeto: anqqa/Anqh
 /**
  * Initializes Facebook Connect
  */
 public static function init()
 {
     widget::add('foot', html::script(array('js/fbconnect.js', 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/en_US')));
     widget::add('foot', html::script_source("FB.init('" . FB::$config['api_key'] . "');"));
     // Add logged in Facebook user id to session for easier access
     if ($logged_in = FB::instance()->get_loggedin_user()) {
         $_SESSION['fb_uid'] = $logged_in;
     }
 }
Exemplo n.º 17
0
 public function connect()
 {
     $conf = Kohana::config('gmail');
     FB::log($conf, "conf");
     //{server.example.com:143/novalidate-cert}INBOX
     $this->inbox = imap_open($conf['connection']['hostname'], $conf['connection']['username'], $conf['connection']['password']) or die('Cannot connect to Gmail: ' . imap_last_error());
     FB::log($this->inbox);
     return $this;
 }
Exemplo n.º 18
0
 /**
  *
  * {@inheritDoc}
  *
  * @see \Psr\Log\LoggerInterface::log()
  */
 public function log($level, $message, array $context = array())
 {
     foreach ($context as $property => $val) {
         if (property_exists($this, $property)) {
             $this->{$property} = $val;
         }
     }
     $fb = new \FB();
     if (!empty($this->options)) {
         $fb->setOptions($this->options);
     }
     $fb->send($message, $this->label, $level);
     if ($level == LogLevel::DEBUG) {
         foreach ($context as $label => $object) {
             $fb->send($object, $label, $level);
         }
     }
 }
Exemplo n.º 19
0
 /**
  * Loads an XML file and loads it's variables into the object.
  * Returns true if successful
  * @access public
  * @param $file
  * @return boolean
  */
 public function load($file)
 {
     if (!is_file($file)) {
         return false;
     }
     $this->variables = $this->to_array(simplexml_load_file($file));
     FB::log($this->variables, '$this->variables');
     return true;
 }
Exemplo n.º 20
0
 protected function loadFormData()
 {
     // Check the session for previously entered form data.
     $data = JFactory::getApplication()->getUserState('com_gglms.edit.file.data', array());
     if (empty($data)) {
         $data = $this->getItem();
     }
     FB::log($data, " loadFormData file");
     return $data;
 }
Exemplo n.º 21
0
 /**
  * Generates HTML to display a given array of entries
  *
  * @param array $entries an array of entries to be formatted
  * @return string HTML markup to display the entry
  */
 protected function generate_template_tags()
 {
     FB::log(debug_backtrace());
     parent::generate_template_tags();
     // Add custom tags here
     foreach ($this->entries as $entry) {
         $entry->comment_count = $this->get_comment_count($entry->entry_id);
         $entry->comment_text = $entry->comment_count === 1 ? 'comment' : 'comments';
         $entry->tags = $this->_format_tags($entry->tags);
     }
 }
Exemplo n.º 22
0
 public static function logError($m)
 {
     $s = self::toStr($m);
     error_log("KLOUDSPEAKER ERROR: " . $s);
     if (self::$firebug) {
         FB::error($m);
     }
     if (self::isDebug()) {
         self::$trace[] = $s;
     }
 }
Exemplo n.º 23
0
 /**
  * Combina i dati e il template generando la parte una o più pagine PDF.
  * Nel template deve essere usata la variabile {$data} che contine tutti
  * i valori passati.
  * 
  * @param string $template 
  * @param string $cache_id identificatore univoco per la copia di cache e di compilazione (default NULL).
  * @param bool $check se TRUE Easy Smarty guarda se il file template &#232; cambiato e lo ricompila (default TRUE). Una volta che l'applicazione viene messa in produzione (quindi i template non cambieranno pi&ugrave;), il passo di check non &#232; pi&ugrave; necessario &#232; consigliabile, per massimizzare  le prestazioni, mettere questo parametro a FALSE.
  * @param bool $cache se TRUE l'output &#232; memorizzato nelle cache (default TRUE).
  * @param int $lifetime tempo di validit&#224; (in secondi) della copia in cache; per default &#232; 120 (2 minuti). $cache deve essere impostato a TRUE perch&#233; $lifetime abbia significato. Un valore di -1 significa cache senza scadenza. Il valore 0 far&#224; s&#236; che la cache venga sempre rigenerata (&#232; utile solo in fase di test, per disabilitare il caching un metodo pi&ugrave; efficiente &#232; impostare $cache a FALSE).
  */
 public function fetch_pdf_template($template, $cache_id = null, $check = true, $cache = false, $lifetime = 120)
 {
     $this->AddPage();
     $smarty = new EasySmarty();
     $smarty->assign('data', $this->_data);
     FB::log($this->_data);
     $html = $smarty->fetch_template($template, $cache_id, $check, $cache, $lifetime);
     FB::log($html);
     $this->writeHTML($html, true, true, true, false, '');
     $this->lastPage();
 }
Exemplo n.º 24
0
function sql($query)
{
    if (DEBUG_PLAIN) {
        return FB::log($query);
    }
    if (SCRIPT_IN) {
        return DataEngine::sql($query);
    }
    $sql = str_replace('SQL_PREFIX_', SQL_PREFIX_, $query);
    $result = mysql_query($sql) or sqlerror($query);
}
Exemplo n.º 25
0
 public function login($username, $password)
 {
     FB::log($username);
     if (USE_LDAP) {
         try {
             $this->ldap->autentificate($username, $password);
         } catch (LdapException $e) {
             throw new LoginException($e);
         }
     }
 }
Exemplo n.º 26
0
 public function executeInit()
 {
     try {
         parent::executeInit();
         if ($this->showConnivance()) {
             FirePHP::getInstance(true)->setEnabled(true);
             FB::setEnabled(true);
         }
     } catch (Exception $e) {
         throw $e;
     }
 }
Exemplo n.º 27
0
 function __destruct()
 {
     if (!$this->status) {
         if (JDEBUG == 1 && defined('JFIREPHP')) {
             FB::log('Kunena upload failed: ' . $this->error);
         }
     }
     // Delete any left over files in temp
     if (is_file($this->fileTemp)) {
         unlink($this->fileTemp);
     }
 }
Exemplo n.º 28
0
 private function _invalid_data(&$checked)
 {
     // nastavi vsetky veci co zadal korektne
     $this->set('room', $checked);
     // nasledne dve nie su previazane na hodnoty v $this->rooms =>
     // ich pouzitie je korektne
     $room_types = $this->room_type->getAll();
     $this->set('room_types', $room_types);
     $equips = $this->rooms->getEquipment();
     FB::error($equips);
     $this->set('equips', $equips);
     $this->set('equip', $_POST['vybavenie']);
 }
Exemplo n.º 29
0
 public function offsetGet($offset)
 {
     global $phpAnvil;
     $return = false;
     if (!$this->exists($offset)) {
         $msg = 'Database, ' . $offset . ', not found.';
         $this->_addTraceInfo(__FILE__, __METHOD__, __LINE__, $msg, self::TRACE_TYPE_DEBUG);
         FB::log($msg);
     } else {
         $return = parent::offsetGet($offset);
     }
     return $return;
 }
Exemplo n.º 30
0
 function save()
 {
     $this->dbh->TransactionBegin();
     $query = "INSERT INTO room (name, capacity, note, room_type)\n\t\t\t VALUES (\$1, \$2, \$3, \$4)";
     $this->dbh->query($query, array($this->nazov, $this->kapacita, $this->poznamka, $this->id_miestnost_typ));
     $id = $this->dbh->GetLastInsertID();
     FB::error($id);
     foreach ($this->vybavenie as $eq) {
         $query = "INSERT INTO room_equipment (id_room,id_equipment)\n            \t VALUES (\$1, \$2)";
         $this->dbh->query($query, array($id, $eq));
     }
     $this->dbh->TransactionEnd();
 }