コード例 #1
0
 public static function getSamlAttributes()
 {
     $values = EfrontConfiguration::getValues();
     return array('saml_enabled' => $values['saml_enabled'], 'saml_integration_type' => $values['saml_integration_type'], 'saml_provider' => $values['saml_provider'], 'saml_fingerprint' => $values['saml_fingerprint'], 'saml_sign_in' => $values['saml_sign_in'], 'saml_sign_out' => $values['saml_sign_out'], 'saml_targeted_id' => $values['saml_targeted_id'], 'saml_first_name' => $values['saml_first_name'], 'saml_last_name' => $values['saml_last_name'], 'saml_email' => $values['saml_email'], 'saml_bool_redirect_validate' => $values['saml_bool_redirect_validate'] ? true : false, 'saml_bool_redirect_sign' => $values['saml_bool_redirect_sign'] ? true : false);
 }
コード例 #2
0
ファイル: api2.php プロジェクト: jiangjunt/efront_open_source
         echo "<xml>";
         echo "<status>error</status>";
         echo "<message>This user does not exist</message>";
         echo "</xml>";
         break;
     }
     try {
         $lesson = new EfrontLesson($_GET['lesson']);
         $info = unserialize($lesson->lesson['info']);
     } catch (Exception $e) {
         echo "<xml>";
         echo "<status>error</status>";
         echo "<message>Lesson doesn't exist</message>";
         echo "</xml>";
     }
     $ef_conf = EfrontConfiguration::getValues();
     $paypal_variables = array("notify_url" => G_SERVERNAME . 'ipn.php', "cmd" => "_xclick", "bn" => "efront_BuyNow_WPS_GR", "amount" => $lesson->lesson['price'], "item_name" => $lesson->lesson['name'], "custom" => $user->user['login'], "item_number" => $lesson->lesson['id'] . ":::", "charset" => "utf-8", "return" => G_SERVERNAME . 'index.php?ctg=checkout&checkout=1&return_paypal=1', "rm" => "2", "cancel_return" => G_SERVERNAME . 'index.php?ctg=checkout&checkout=1&register_lessons=1&message=You+have+cancelled+the+transaction', "currency_code" => $GLOBALS['configuration']['currency'], "business" => strtolower($ef_conf['paypalbusiness']), "undefined_quantity" => "0", "address_override" => "1", "upload" => "1", "no_note" => "1", "no_shipping" => "1", "cbt" => "Return to " . $ef_conf['site_name']);
     $paypal_url = "https://www.paypal.com/cgi-bin/webscr";
     $query_string = "?";
     foreach ($paypal_variables as $name => $value) {
         $query_string .= $name . "=" . $value . "&";
     }
     $redirect_url = $paypal_url . urlencode($query_string);
     echo "<xml>";
     echo "<redirect_url>" . $redirect_url . "</redirect_url>";
     echo "</xml>";
 } else {
     echo "<xml>";
     echo "<status>error</status>";
     echo "<message>Invalid token</message>";
     echo "</xml>";
コード例 #3
0
set_include_path($path . '../PEAR/' . PATH_SEPARATOR . $path . 'includes/' . PATH_SEPARATOR . $path . PATH_SEPARATOR . get_include_path());
//Fix IIS bug by setting the request URI
setRequestURI();
//Set global defines for the system
setDefines();
//Set default exception handler to be defaultExceptionHandler() function
set_exception_handler('defaultExceptionHandler');
register_shutdown_function('shutdownFunction');
/** General tools for system */
require_once "tools.php";
/** Database manipulation functions*/
require_once "database.php";
/** General class representing an entity*/
require_once "entity.class.php";
//Get configuration values
$configuration = EfrontConfiguration::getValues();
//Set debugging parameter
if ($configuration['debug_mode'] == '1' || $_SESSION['s_login'] && in_array($_SESSION['s_login'], explode(",", $configuration['debug_mode']))) {
    define("G_DEBUG", 1);
    if (isset($_GET['debug'])) {
        debug();
        define("NO_OUTPUT_BUFFERING", 1);
    }
} else {
    define("G_DEBUG", 0);
}
//Turn on compressed output buffering, unless NO_OUTPUT_BUFFERING is defined or it's turned off from the configuration
!defined('NO_OUTPUT_BUFFERING') && $configuration['gz_handler'] ? ob_start("ob_gzhandler") : null;
//Set the memory_limit and max_execution_time PHP settings, but only if system-specific values are greater than global
isset($configuration['memory_limit']) && $configuration['memory_limit'] && str_replace("M", "", ini_get('memory_limit')) < $configuration['memory_limit'] ? ini_set('memory_limit', $configuration['memory_limit'] . 'M') : null;
isset($configuration['max_execution_time']) && $configuration['max_execution_time'] && ini_get('max_execution_time') < $configuration['max_execution_time'] ? ini_set('max_execution_time', $configuration['max_execution_time']) : null;
コード例 #4
0
                $GLOBALS['db']->Execute("truncate cache");
                $GLOBALS['db']->Execute("set foreign_key_checks=1");
                //Create the file libraries/configuration.php
                Installation::createConfigurationFile($values);
                /**Include the file configuration.php*/
                require_once $path . "configuration.php";
                if (stripos(php_uname(), 'windows') !== false) {
                    EfrontConfiguration::setValue('file_encoding', 'UTF7-IMAP');
                }
                EfrontConfiguration::setValue('version_type', G_VERSIONTYPE);
                EfrontConfiguration::setValue('version_users', '');
                EfrontConfiguration::setValue('version_activated', '');
                EfrontConfiguration::setValue('version_upgrades', '');
                EfrontConfiguration::setValue('version_key', '');
                EfrontConfiguration::setValue('time_zone', date_default_timezone_get());
                $defaultConfig = EfrontConfiguration::getValues();
                $phplivedocxConfig = '<?php
define("PATH_ZF","' . G_ROOTPATH . 'Zend/library/' . '");
define("USERNAME","' . $defaultConfig['phplivedocx_username'] . '");
define("PASSWORD","' . $defaultConfig['phplivedocx_password'] . '");
define("PHPLIVEDOCXAPI","' . $defaultConfig['phplivedocx_server'] . '");
?>';
                file_put_contents($path . "phplivedocx_config.php", $phplivedocxConfig);
                eF_updateTableData("users", array('email' => $values['admin_email'], 'password' => EfrontUser::createPassword($values['admin_password']), 'last_login' => '0'));
                eF_updateTableData("users", array('login' => $values['admin_name']), "id=1");
                eF_updateTableData("courses", array('created' => time()));
                eF_updateTableData("courses", array('created' => time(), 'creator_LOGIN' => $values['admin_name']));
                eF_updateTableData("lessons", array('created' => time(), 'creator_LOGIN' => $values['admin_name']));
                eF_updateTableData("users_to_courses", array('from_timestamp' => time()));
                eF_updateTableData("users_to_lessons", array('from_timestamp' => time()));
                eF_deleteTableData("logs", "");