本文整理汇总了PHP中PhpFox类 的典型用法代码示例。如果您正苦于以下问题:PHP PhpFox类的具体用法?PHP PhpFox怎么用?PHP PhpFox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PhpFox类 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
//DROPBOX
//Request Unlink Dropbox Acount
if ($this->request()->get('unlink')) {
Phpfox::getService('backuprestore.dropboxfront')->unlink_account();
$this->isAccess = null;
$page = $_SERVER['HTTP_REFERER'];
$sec = "0";
header("Refresh: {$sec}; url={$page}");
}
$canCall = false;
if (!$this->request()->get('db_authorize')) {
$this->dropbox = PhpFox::getService('backuprestore.dropboxfront');
$canCall = true;
}
$dbauthorize = array();
if ($canCall) {
$dbauthorize['Url'] = $this->dropbox->get_authorize_url();
if ($this->dropbox->is_authorized()) {
//User Dropbox info
$dbaccount_info = $this->dropbox->get_account_info();
$dbaccount_details = array('account_owner' => $dbaccount_info->display_name, 'used_space' => round(($dbaccount_info->quota_info->quota - ($dbaccount_info->quota_info->normal + $dbaccount_info->quota_info->shared)) / 1073741824, 1), 'quota' => round($dbaccount_info->quota_info->quota / 1073741824, 1));
$dbaccount_details['used_percent'] = round($dbaccount_details['used_space'] / $dbaccount_details['quota'] * 100, 0);
$this->authorized['dropbox'] = 1;
} else {
if ($this->request()->get('continue')) {
if (!$this->dropbox->is_authorized()) {
$dbauthorize['error_not_authorized'] = 'yes';
}
$dbauthorize['submitbutton'] = 'Authorize';
}
}
}
//Request Authorize Dropbox Account
if ($this->request()->get('db_authorize')) {
$dbauthorize['submitbutton'] = 'Continue';
}
$this->template()->assign(array('dbauthorize' => $dbauthorize, 'DBADetails' => !empty($dbaccount_details) ? $dbaccount_details : null, 'authorized' => $this->authorized));
}
开发者ID:googlesky, 项目名称:snsp.vn, 代码行数:43, 代码来源:dropbox.class.php
示例2: _import
private function _import()
{
Phpfox::getLib('phpfox.process')->import(Phpfox::getLib('xml.parser')->parse(PHPFOX_DIR_XML . 'version' . PHPFOX_XML_SUFFIX));
PhpFox::getService('core.country.process')->importForInstall(Phpfox::getLib('xml.parser')->parse(PHPFOX_DIR_XML . 'country' . PHPFOX_XML_SUFFIX));
// $this->_pass();
/*
$this->_oTpl->assign(array(
'sMessage' => 'Imports complete...',
'sNext' => $this->_step('language')
));
*/
return ['message' => 'Importing language package', 'next' => 'language'];
}
开发者ID:nima7r, 项目名称:phpfox-dist, 代码行数:13, 代码来源:installer.class.php
示例3: add
public function add($aVals, $bClean = false)
{
$sPhrase = $this->prepare($aVals['var_name']);
$oParseInput = Phpfox_Parse_Input::instance();
if (isset($aVals['module'])) {
$aParts = explode('|', $aVals['module']);
}
foreach ($aVals['text'] as $iId => $sText) {
$sText = trim($sText);
if (empty($sText)) {
// continue;
}
if ($bClean === true) {
$sText = $oParseInput->clean($sText);
} else {
$sText = $oParseInput->convert($sText);
}
$this->database()->insert($this->_sTable, array('language_id' => $iId, 'module_id' => isset($aParts) ? $aParts[0] : 'core', 'product_id' => $aVals['product_id'], 'version_id' => PhpFox::getId(), 'var_name' => $sPhrase, 'text' => $sText, 'text_default' => $sText, 'added' => PHPFOX_TIME));
}
$sFinalPhrase = isset($aVals['module']) ? $aParts[1] . '.' . $sPhrase : $sPhrase;
if (isset($aVals['is_help'])) {
Phpfox::getService('help.process')->add(array('var_name' => $sFinalPhrase));
}
Phpfox::getService('log.staff')->add('phrase', 'add', array('phrase' => $sPhrase));
$this->cache()->remove('locale', 'substr');
return $sFinalPhrase;
}
开发者ID:lev1976g, 项目名称:core, 代码行数:27, 代码来源:process.class.php
示例4: __construct
public function __construct()
{
require_once 'module/backuprestore/Dropbox/API.php';
require_once 'module/backuprestore/Dropbox/OAuth/Consumer/ConsumerAbstract.class.php';
require_once 'module/backuprestore/Dropbox/OAuth/Consumer/Curl.class.php';
$this->btdbsett = PhpFox::getService('backuprestore.backuprestore');
if (!extension_loaded('curl')) {
Phpfox_Error::set(Phpfox::getPhrase('testsearch.curl_not_loaded_message'));
}
$this->oauth = new Backuprestore_Dropbox_OAuth_Consumer_Curl($this->app_key, $this->app_secret);
if ($dbarray = $this->btdbsett->getBTDBSettingByName('dropbox_tokens')) {
$this->tokens = unserialize(array_shift($dbarray));
}
//Convert array to stdClass for the new API
if ($this->tokens && is_array($this->tokens['access'])) {
$accessToken = new stdClass();
$accessToken->oauth_token = $this->tokens['access']["token"];
$accessToken->oauth_token_secret = $this->tokens['access']["token_secret"];
$this->tokens['access'] = $accessToken;
$this->tokens['state'] = 'access';
}
try {
$this->init();
//If we are in the access state and are still not authorized then unlink and re init
if ($this->tokens['state'] == 'access' && !$this->is_authorized()) {
throw new Exception();
}
} catch (Exception $e) {
$this->unlink_account();
$this->init();
}
}
开发者ID:googlesky, 项目名称:snsp.vn, 代码行数:32, 代码来源:dropboxfront.class.php
示例5: add
public function add($aVals, $aFiles)
{
$sInteraction = $aVals['name'];
$sAction = $aVals['action'];
if ($this->database()->select('id')->from(Phpfox::getT('interactions'))->where('name = "' . $sInteraction . '"')->execute('getSlaveField')) {
Phpfox_Error::set(Phpfox::getPhrase('interact.already_added'));
return false;
}
if ($aFiles['image']['name'] != '') {
$oFile = Phpfox::getLib('file');
$oImage = Phpfox::getLib('image');
if ($oFile->load('image', array('jpg', 'png', 'gif'))) {
$sPath = Phpfox::getParam('core.dir_pic') . 'interact/';
$sFileName = basename($aFiles['image']['name']);
move_uploaded_file($aFiles['image']['tmp_name'], $sPath . $sFileName);
$aSize = getimagesize($sPath . $sFileName);
if ($aSize[0] < 120 || $aSize[1] < 120) {
Phpfox_Error::set(Phpfox::getPhrase('interact.image_too_small'));
return false;
}
if ($aSize[0] > 120 || $aSize[1] > 120) {
$oImage->createThumbnail($sPath . $sFileName, $sPath . substr_replace(basename($sFileName), '_120', -4, 0), 120, 120);
$oImage->createThumbnail($sPath . $sFileName, $sPath . substr_replace(basename($sFileName), '_75', -4, 0), 75, 75);
unlink($sPath . $sFileName);
}
}
}
$aDisallow = array();
$aUserGroups = Phpfox::getService('user.group')->get();
foreach ($aUserGroups as $aKey => $aUserGroup) {
if ($aUserGroups[$aKey]['user_group_id'] == 3 || $aUserGroups[$aKey]['user_group_id'] == 5) {
unset($aUserGroups[$aKey]);
}
}
if (isset($aVals['allow_access'])) {
foreach ($aUserGroups as $aUserGroup) {
if (!in_array($aUserGroup['user_group_id'], $aVals['allow_access'])) {
$aDisallow[] = $aUserGroup['user_group_id'];
}
}
} else {
foreach ($aUserGroups as $aUserGroup) {
$aDisallow[] = $aUserGroup['user_group_id'];
}
}
$aVals['disallow_access'] = count($aDisallow) ? serialize($aDisallow) : null;
$iOldPos = $this->database()->select('`position`')->from(Phpfox::getT('interactions'))->order('position DESC')->limit(1)->execute('getField');
$iId = $this->database()->insert(Phpfox::getT('interactions'), array('name' => Phpfox::getLib('parse.input')->clean($sInteraction, 255), 'action' => Phpfox::getLib('parse.input')->clean($sAction, 255), 'image' => $aFiles['image']['name'] ? substr_replace(basename($aFiles['image']['name']), '%s', -4, 0) : '', 'disallow_access' => $aVals['disallow_access'], 'position' => $iOldPos + 1));
$aLangs = $this->database()->select('`language_id`')->from(Phpfox::getT('language'))->execute('getRows');
$oParseInput = Phpfox::getLib('parse.input');
foreach ($aLangs as $aKey => $sLang) {
$sInteraction = Phpfox::getLib('parse.input')->clean($sInteraction, 128);
$sIntName = Phpfox::getService('language.phrase.process')->prepare($sInteraction);
$this->database()->insert(Phpfox::getT('language_phrase'), array('language_id' => $sLang['language_id'], 'module_id' => 'interact', 'product_id' => 'rael_interact', 'version_id' => PhpFox::getId(), 'var_name' => 'name_' . $sIntName, 'text' => $sInteraction, 'text_default' => $sInteraction, 'added' => PHPFOX_TIME));
$sAction = Phpfox::getLib('parse.input')->clean($sAction, 128);
$this->database()->insert(Phpfox::getT('language_phrase'), array('language_id' => $sLang['language_id'], 'module_id' => 'interact', 'product_id' => 'rael_interact', 'version_id' => PhpFox::getId(), 'var_name' => 'action_' . $sIntName, 'text' => $sAction, 'text_default' => $sAction, 'added' => PHPFOX_TIME));
}
$this->cache()->remove('locale', 'substr');
return $iId;
}
开发者ID:Lovinity, 项目名称:EQM, 代码行数:60, 代码来源:manage.class.php
示例6: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
//DROPBOX
$canCall = false;
if (!$this->request()->get('db_authorize')) {
$this->dropbox = PhpFox::getService('backuprestore.dropboxfront');
$canCall = true;
}
$dbauthorize = array();
if ($canCall) {
$dbauthorize['Url'] = $this->dropbox->get_authorize_url();
if ($this->dropbox->is_authorized()) {
//User Dropbox info
$dbaccount_info = $this->dropbox->get_account_info();
$dbaccount_details = array('account_owner' => $dbaccount_info->display_name, 'used_space' => round(($dbaccount_info->quota_info->quota - ($dbaccount_info->quota_info->normal + $dbaccount_info->quota_info->shared)) / 1073741824, 1), 'quota' => round($dbaccount_info->quota_info->quota / 1073741824, 1));
$dbaccount_details['used_percent'] = round($dbaccount_details['used_space'] / $dbaccount_details['quota'] * 100, 0);
$this->authorized['dropbox'] = 1;
} else {
if ($this->request()->get('continue')) {
if (!$this->dropbox->is_authorized()) {
$dbauthorize['error_not_authorized'] = 'yes';
}
$dbauthorize['submitbutton'] = 'Authorize';
}
}
}
//Request Authorize Dropbox Account
if ($this->request()->get('db_authorize')) {
$dbauthorize['submitbutton'] = 'Continue';
}
//Google DRIVE
$gdrive = PhpFox::getService('backuprestore.googledrivefront');
$tokens = $gdrive->getAccessTokens();
//Check Google drive User Authorization
if ($gdrive->is_authorized()) {
//User Google Drive info
try {
if (isset($tokens)) {
$drive = $gdrive->buildService($tokens);
$gdrive_info = $gdrive->getAcountInfo($drive);
$this->authorized['gdrive'] = 1;
}
} catch (Exception $e) {
throw $e;
}
}
// Google Drive Authorize
if ($this->request()->get('gd_authorize')) {
if (!$gdrive->initClientKeys()) {
$this->url()->forward($this->url()->makeUrl('admincp.backuprestore.gdrivesett'), 'In order to use Google Drive Service fill below requirements');
}
try {
$gdrive->gdrive_auth_request();
} catch (Exception $e) {
Phpfox::addMessage($e->getMessage());
}
}
$this->template()->assign(array('dbauthorize' => $dbauthorize, 'gdrive_info' => !empty($gdrive_info) ? $gdrive_info : null, 'DBADetails' => !empty($dbaccount_details) ? $dbaccount_details : null, 'authorized' => $this->authorized));
}
开发者ID:googlesky, 项目名称:snsp.vn, 代码行数:62, 代码来源:authorize.class.php
示例7: add
public function add($aVals, $bIsUpdate = false)
{
if (empty($aVals['module_id'])) {
$aVals['module_id'] = 'core|core';
}
$aModule = explode('|', $aVals['module_id']);
// Find the user groups we disallowed
$aDisallow = array();
$aUserGroups = Phpfox::getService('user.group')->get();
if (isset($aVals['allow_access'])) {
foreach ($aUserGroups as $aUserGroup) {
if (!in_array($aUserGroup['user_group_id'], $aVals['allow_access'])) {
$aDisallow[] = $aUserGroup['user_group_id'];
}
}
} else {
foreach ($aUserGroups as $aUserGroup) {
$aDisallow[] = $aUserGroup['user_group_id'];
}
}
foreach ($aVals['text'] as $iId => $sText) {
$sVarName = $aModule[0] . '_' . Phpfox::getService('language.phrase.process')->prepare($sText);
break;
}
$sVarName = 'menu_' . $sVarName . '_' . md5($aVals['m_connection']);
$aInsert = array('page_id' => isset($aVals['page_id']) ? (int) $aVals['page_id'] : 0, 'm_connection' => strtolower($aVals['m_connection']), 'module_id' => $aModule[0], 'product_id' => $aVals['product_id'], 'is_active' => 1, 'url_value' => $aVals['url_value'], 'disallow_access' => count($aDisallow) ? serialize($aDisallow) : null, 'mobile_icon' => empty($aVals['mobile_icon']) ? null : $aVals['mobile_icon']);
if (preg_match('/child\\|(.*)/i', $aVals['m_connection'], $aMatches)) {
if (isset($aMatches[1])) {
$aInsert['m_connection'] = null;
$aInsert['parent_id'] = $aMatches[1];
}
} else {
if ($aVals['m_connection'] == 'explore' || $aVals['m_connection'] == 'main') {
$aInsert['parent_id'] = 0;
}
}
if ($bIsUpdate) {
$this->database()->update($this->_sTable, $aInsert, 'menu_id = ' . (int) $aVals['menu_id']);
foreach ($aVals['text'] as $iId => $sText) {
Phpfox::getService('language.phrase.process')->update($iId, $sText, array('module_id' => $aModule[0]));
}
} else {
// Get the last order number
$iLastCount = $this->database()->select('ordering')->from($this->_sTable)->order('ordering DESC')->execute('getField');
// Define some remaining vars we plan to insert
$aInsert['ordering'] = $iLastCount + 1;
$aInsert['version_id'] = PhpFox::getId();
$aInsert['var_name'] = $sVarName;
// Insert into DB
$this->database()->insert($this->_sTable, $aInsert);
// Add the new phrase
Phpfox::getService('language.phrase.process')->add(array('var_name' => $sVarName, 'module' => $aVals['module_id'], 'product_id' => $aVals['product_id'], 'text' => $aVals['text']));
}
// Clear the menu cache using the substr method, which will clear anything that has a "menu" prefix
$this->cache()->remove();
return true;
}
开发者ID:Lovinity, 项目名称:EQM, 代码行数:57, 代码来源:process.class.php
示例8: get
public function get()
{
$oFile = Phpfox::getLib('file');
$bSlaveEnabled = Phpfox::getParam(array('db', 'slave'));
$sDriver = Phpfox::getParam(array('db', 'driver'));
$aStats = array
(
Phpfox::getPhrase('admincp.phpfox_version') => PhpFox::getVersion() . '<i>(build ' . Phpfox::getBuild() . ')</i>',
Phpfox::getPhrase('admincp.php_version') => '<a href="' . Phpfox::getLib('url')->makeUrl('admincp.core.phpinfo') . '">' . PHP_VERSION . '</a>',
Phpfox::getPhrase('admincp.php_sapi') => php_sapi_name(),
Phpfox::getPhrase('admincp.php_safe_mode') => (PHPFOX_SAFE_MODE ? Phpfox::getPhrase('admincp.true') : Phpfox::getPhrase('admincp.false')),
Phpfox::getPhrase('admincp.php_open_basedir') => (PHPFOX_OPEN_BASE_DIR ? Phpfox::getPhrase('admincp.true') : Phpfox::getPhrase('admincp.false')),
Phpfox::getPhrase('admincp.php_disabled_functions') => (@ini_get('disable_functions') ? str_replace( ",", ", ", @ini_get('disable_functions') ) : Phpfox::getPhrase('admincp.none')),
Phpfox::getPhrase('admincp.php_loaded_extensions') => implode(' ', get_loaded_extensions()),
Phpfox::getPhrase('admincp.operating_system') => PHP_OS,
Phpfox::getPhrase('admincp.server_time_stamp') => date('F j, Y, g:i a', PHPFOX_TIME) . ' (GMT)',
Phpfox::getPhrase('admincp.gzip') => (Phpfox::getParam('core.use_gzip') ? Phpfox::getPhrase('admincp.enabled') : Phpfox::getPhrase('admincp.disabled')),
Phpfox::getPhrase('admincp.sql_driver_version') => ($sDriver == 'DATABASE_DRIVER' ? Phpfox::getPhrase('admincp.n_a') : Phpfox::getLib('database')->getServerInfo()),
Phpfox::getPhrase('admincp.sql_slave_enabled') => ($bSlaveEnabled ? Phpfox::getPhrase('admincp.yes') : Phpfox::getPhrase('admincp.no')),
Phpfox::getPhrase('admincp.sql_total_slaves') => ($bSlaveEnabled ? count(Phpfox::getParam(array('db', 'slave_servers'))) : Phpfox::getPhrase('admincp.n_a')),
Phpfox::getPhrase('admincp.sql_slave_server') => ($bSlaveEnabled ? Phpfox::getLib('database')->sSlaveServer : Phpfox::getPhrase('admincp.n_a')),
Phpfox::getPhrase('admincp.memory_limit') => $oFile->filesize($this->_getUsableMemory()) . ' (' . @ini_get('memory_limit') . ')',
Phpfox::getPhrase('admincp.load_balancing_enabled') => (Phpfox::getParam(array('balancer', 'enabled')) ? Phpfox::getPhrase('admincp.yes') : Phpfox::getPhrase('admincp.no'))
);
if(strpos(strtolower(PHP_OS), 'win') === 0 || PHPFOX_SAFE_MODE || PHPFOX_OPEN_BASE_DIR)
{
}
else
{
$sMemory = @shell_exec("free -m");
$aMemory = explode("\n", str_replace( "\r", "", $sMemory));
if (is_array($aMemory))
{
$aMemory = array_slice($aMemory, 1, 1);
if (isset($aMemory[0]))
{
$aMemory = preg_split("#\s+#", $aMemory[0]);
$aStats[Phpfox::getPhrase('admincp.total_server_memory')] = (isset($aMemory[1]) ? $aMemory[1] . ' MB' : '--');
$aStats[Phpfox::getPhrase('admincp.available_server_memory')] = (isset($aMemory[3]) ? $aMemory[3] . ' MB' : '--');
}
}
}
if (!PHPFOX_OPEN_BASE_DIR && ($sLoad = Phpfox::getService('core.load')->get()) !== null)
{
$aStats[Phpfox::getPhrase('admincp.current_server_load')] = $sLoad;
}
return $aStats;
}
开发者ID:hoanghd, 项目名称:tools, 代码行数:54, 代码来源:system.class.php
示例9: displayCaptcha
public function displayCaptcha($sText)
{
Phpfox::getParam('captcha.captcha_use_font') && function_exists('imagettftext') ? $this->_writeFromFont($sText) : $this->_writeFromString($sText);
ob_clean();
header("X-Content-Encoded-By: phpFox " . PhpFox::getVersion());
header("Pragma: no-cache");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Content-Type: image/jpeg');
imagejpeg($this->_hImg);
imagedestroy($this->_hImg);
}
开发者ID:googlesky, 项目名称:snsp.vn, 代码行数:11, 代码来源:captcha.class.php
示例10: process
public function process()
{
$this->googledrive = PhpFox::getService('backuprestore.googledrivefront');
$this->btdbsett = PhpFox::getService('backuprestore.backuprestore');
//Clients deny for Application Register
if (isset($_GET['error'])) {
$this->url()->forward($this->url()->makeUrl('backuprestore.continue'), Phpfox::getPhrase('backuprestore.gd_auth_deny'));
}
//Get Access Tokens usung authorization code returnedfrom Google API
if (isset($_GET['code'])) {
try {
$this->tokens['access_token'] = $this->googledrive->exchangeCode($_GET['code']);
if (!empty($this->tokens['access_token'])) {
$this->btdbsett->addBTDBSetting('googledrive_tokens', serialize(json_decode($this->tokens['access_token'], true)));
}
//Redirct to main page
$this->url()->forward($this->url()->makeUrl('admincp.backuprestore.destination'), Phpfox::getPhrase('backuprestore.gd_register_complete'));
} catch (Exception $e) {
$e->getMessage();
}
}
//Insert GDrive client keys
if ($aVals = $this->request()->getArray('val')) {
if (empty($aVals['gdrive_clientid'])) {
return Phpfox_Error::set(Phpfox::getPhrase('backuprestore.please_insert_your_application_client_id'));
}
if (empty($aVals['gdrive_clientsecret'])) {
return Phpfox_Error::set(Phpfox::getPhrase('backuprestore.please_insert_your_application_client_secret_key'));
}
if (Phpfox_Error::isPassed()) {
if ($gdrive = Phpfox::getService('backuprestore.process')->addGDriveKeys($aVals)) {
$this->url()->send('admincp.backuprestore.gdrivesett', null, Phpfox::getPhrase('backuprestore.changes_successfully_saved'));
}
}
}
//Values from DB for edit
$gdkeys = Phpfox::getService('backuprestore.backuprestore')->getBTDBSettingByName('gdclient_keys');
if (!empty($gdkeys)) {
$gdkeys = unserialize(array_shift($gdkeys));
$this->template()->assign('aForms', $gdkeys);
}
$this->template()->assign(array('redirect_url' => 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'support_page' => $this->url()->makeUrl('admincp.backuprestore.gdrivesupp')));
$this->template()->setBreadcrumb(Phpfox::getPhrase('backuprestore.google_drive'), $this->url()->makeUrl('admincp.backuprestore.gdrivesett'))->setHeader(array('btdbstyles.css' => 'module_backuprestore', 'scripts.js' => 'module_backuprestore'));
}
开发者ID:googlesky, 项目名称:snsp.vn, 代码行数:44, 代码来源:gdrivesett.class.php
示例11: __construct
public function __construct()
{
require_once 'module/backuprestore/Google/Google_Client.php';
require_once 'module/backuprestore/Google/contrib/Google_DriveService.php';
require_once 'module/backuprestore/Google/contrib/Google_Oauth2Service.php';
$this->btdbsett = PhpFox::getService('backuprestore.backuprestore');
if (!$this->initClientKeys()) {
return;
// Phpfox::addMessage('Error');
}
$this->client = new Google_Client();
$this->client->setApplicationName(Phpfox::getPhrase('backuprestore.phpfox_backup_into_cloud'));
$this->client->setScopes($this->SCOPES);
try {
$this->init();
//If we are in the access state and are still not authorized then unlink and re init
if (!$this->is_authorized()) {
throw new Exception();
}
} catch (Exception $e) {
//Phpfox::addMessage(Phpfox::getPhrase('backuprestore.google_drive_error_when_requesting_access_token')); //re authorize user
}
}
开发者ID:googlesky, 项目名称:snsp.vn, 代码行数:23, 代码来源:googledrivefront.class.php
示例12: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
// Google Drive Authorize
if ($this->request()->get('gd_authorize')) {
if (!PhpFox::getService('backuprestore.googledrivefront')->initClientKeys()) {
$this->url()->forward($this->url()->makeUrl('admincp.backuprestore.gdrivesett'), 'In order to use Google Drive Service fill below requirements');
}
try {
PhpFox::getService('backuprestore.googledrivefront')->gdrive_auth_request();
} catch (Exception $e) {
Phpfox::addMessage($e->getMessage());
}
}
// Google Drive Unauthorize
if ($this->request()->get('gd_unauthorize')) {
try {
Phpfox::getService('backuprestore.googledrivefront')->gdrive_auth_revoke();
} catch (Exception $re) {
}
}
$gdrive = PhpFox::getService('backuprestore.googledrivefront');
$tokens = $gdrive->getAccessTokens();
//Check Google drive User Authorization
if ($gdrive->is_authorized()) {
//User Google Drive info
try {
if (isset($tokens)) {
$drive = $gdrive->buildService($tokens);
$gdrive_info = $gdrive->getAcountInfo($drive);
$this->authorized['gdrive'] = 1;
}
} catch (Exception $e) {
throw $e;
}
}
$this->template()->assign(array('gdrive_info' => !empty($gdrive_info) ? $gdrive_info : null, 'authorized' => $this->authorized));
}
开发者ID:googlesky, 项目名称:snsp.vn, 代码行数:40, 代码来源:gdrive.class.php
示例13: add
public function add($aVals)
{
switch ($aVals['type']) {
case 'array':
// Make sure its an array
if (preg_match("/^array\\((.*)\\);\$/i", $aVals['value'])) {
$aVals['value'] = serialize($aVals['value']);
} else {
return Phpfox_Error::set(Phpfox::getPhrase('admincp.not_valid_array'));
}
break;
case 'integer':
if (!is_numeric($aVals['value'])) {
return Phpfox_Error::set(Phpfox::getPhrase('admincp.value_must_be_numeric'));
}
break;
case 'drop':
$aDropDowns = explode(',', $aVals['value']);
$aVals['value'] = serialize(array('default' => $aDropDowns[0], 'values' => $aDropDowns));
break;
default:
break;
}
$iGroupId = $aVals['group_id'];
$iModule = $aVals['module_id'];
$iProductId = $aVals['product_id'];
$aVals['var_name'] = preg_replace('/ +/', '_', preg_replace('/[^0-9a-zA-Z_ ]+/', '', trim($aVals['var_name'])));
$aVals['var_name'] = strtolower($aVals['var_name']);
$sPhrase = 'setting_' . Phpfox::getService('language.phrase.process')->prepare($aVals['var_name']);
$iLastOrder = $this->database()->select('ordering')->from($this->_sTable)->where("group_id = '{$iGroupId}' AND module_id = '{$iModule}' AND product_id = '{$iProductId}'")->order('ordering DESC')->execute('getSlaveField');
$iId = $this->database()->insert($this->_sTable, array('group_id' => empty($iGroupId) ? null : $iGroupId, 'module_id' => empty($iModule) ? null : $iModule, 'product_id' => $iProductId, 'version_id' => PhpFox::getId(), 'type_id' => $aVals['type'], 'var_name' => $aVals['var_name'], 'phrase_var_name' => $sPhrase, 'value_actual' => $aVals['value'], 'value_default' => $aVals['value'], 'ordering' => (int) $iLastOrder + 1));
$sPhrase = Phpfox::getService('language.phrase.process')->add(array('var_name' => 'setting_' . $aVals['var_name'], 'product_id' => $iProductId, 'module' => empty($iModule) ? 'core|core' : $iModule . '|' . $iModule, 'text' => array('en' => '<title>' . $aVals['title'] . '</title><info>' . $aVals['info'] . '</info>')));
// Clear the setting cache
$this->cache()->remove('setting');
return (empty($iModule) ? '' : $iModule . '.') . $aVals['var_name'];
}
开发者ID:nima7r, 项目名称:phpfox-dist, 代码行数:36, 代码来源:process.class.php
示例14: export
/**
* Creates an XML export of all the files in the product and includes an MD5 hash
* that identifies each of the files content
*
* @return string XML output
*/
public function export()
{
$oXmlBuilder = Phpfox::getLib('xml.builder');
$oXmlBuilder->addGroup('files', array('version' => PhpFox::getId()));
$aFiles = $this->_getFiles(rtrim(PHPFOX_DIR, PHPFOX_DS));
sort($aFiles);
foreach ($aFiles as $sFile) {
if (preg_match("/\\.svn/i", $sFile) || preg_match("/tiny_mce/i", $sFile) || preg_match("/fckeditor/i", $sFile) || preg_match("/file\\/cache/i", $sFile) || preg_match("/jscript\\/jquery/i", $sFile) || preg_match("/include\\/hook/i", $sFile) || preg_match("/file\\\\cache/i", $sFile) || preg_match("/file\\\\static/i", $sFile) || preg_match("/jscript\\\\jquery/i", $sFile) || preg_match("/include\\\\plugin/i", $sFile) || substr($sFile, -4) != '.php' && substr($sFile, -5) != '.html' && substr($sFile, -4) != '.css' && substr($sFile, -3) != '.js') {
continue;
}
$aFile = file($sFile);
$sSource = '';
foreach ($aFile as $sLine) {
$sCheckLine = trim($sLine);
if ($sCheckLine == '' || $sCheckLine == '/**' || $sCheckLine == '*' || $sCheckLine == '*/' || substr($sCheckLine, 0, 1) == '*' || substr($sCheckLine, 0, 2) == '//') {
continue;
}
$sSource .= $sLine;
}
$oXmlBuilder->addTag('file', str_replace('\\', '/', str_replace(PHPFOX_DIR, '', $sFile)), array('hash' => md5($sSource)));
}
$oXmlBuilder->closeGroup();
return $oXmlBuilder->output();
}
开发者ID:Lovinity, 项目名称:EQM, 代码行数:30, 代码来源:md5.class.php
示例15: __construct
/**
* Class constructor
*/
public function __construct()
{
$this->_sTable = PhpFox::getT('quiz');
}
开发者ID:nima7r, 项目名称:phpfox-dist, 代码行数:7, 代码来源:process.class.php
示例16: process
//.........这里部分代码省略.........
$aMenus['admincp.extensions']['attachment.admincp_attachment_menu'] = array(
'attachment.admincp_menu_attachment_types' => 'admincp.attachment',
'attachment.admincp_menu_attachment_add' => 'admincp.attachment.add'
);
}
if (!Phpfox::getParam('core.branding'))
{
$aMenus['admincp.settings']['core.phpfox_branding_removal'] = 'admincp.core.branding';
}
if (Phpfox::getParam('core.phpfox_is_hosted'))
{
unset($aMenus['admincp.extensions']['admincp.module']);
unset($aMenus['admincp.extensions']['admincp.products']['admincp.create_new_product']);
unset($aMenus['admincp.extensions']['admincp.products']['admincp.import_export']);
unset($aMenus['admincp.extensions']['admincp.plugin']);
unset($aMenus['admincp.extensions']['admincp.language']['language.import_language_pack']);
unset($aMenus['admincp.extensions']['admincp.theme']['theme.create_a_new_template']);
unset($aMenus['admincp.extensions']['admincp.theme']['theme.admincp_create_css_file']);
unset($aMenus['admincp.extensions']['admincp.theme']['theme.admincp_menu_import_themes']);
unset($aMenus['admincp.extensions']['admincp.theme']['theme.admincp_menu_import_styles']);
unset($aMenus['admincp.extensions']['emoticon.emoticons']['emoticon.import_export_emoticon']);
unset($aMenus['admincp.settings']['admincp.system_settings_menu']['admincp.add_new_setting']);
unset($aMenus['admincp.settings']['admincp.system_settings_menu']['admincp.add_new_setting_group']);
}
(($sPlugin = Phpfox_Plugin::get('admincp.component_controller_index_process_menu')) ? eval($sPlugin) : false);
$this->template()->assign(array(
'aModulesMenu' => $aModules,
'aAdminMenus' => $aMenus,
'aUserDetails' => Phpfox::getUserBy(),
'sPhpfoxVersion' => PhpFox::getVersion(),
'sSiteTitle' => Phpfox::getParam('core.site_title')
)
)->setHeader(array(
'menu.css' => 'style_css',
"<!--[if IE]\n\t\t\t<link rel=\"stylesheet\" href=\"" . $this->template()->getStyle('css') . "ie.css\">\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t window.mlrunShim = true;\n\t\t\t</script>\n\t\t<![endif]-->",
'menu.js' => 'style_script',
"<!--[if lt IE 7]>\n\t\t\t<link rel=\"stylesheet\" href=\"" . $this->template()->getStyle('css') . "ie6.css\">\n\t\t<![endif]-->",
"<!--[if IE 6]>\n\t\t\t<script type=\"text/javascript\" src=\"" . Phpfox::getParam('core.url_static_script') . "admin_ie6.js\"></script>\n\t\t<![endif]-->",
'admin.js' => 'static_script'
)
)->setTitle(Phpfox::getPhrase('admincp.admin_cp'));
if ($bPass)
{
Phpfox::getLib('module')->setController($this->_sModule . '.' . $this->_sController);
$sMenuController = str_replace(array('.index', '.phrase'), '', 'admincp.' . ($this->_sModule != 'admincp' ? $this->_sModule . '.' . str_replace('admincp.', '', $this->_sController) : $this->_sController));
$aCachedSubMenus = array();
$sActiveSideBar = '';
if ($sMenuController == 'admincp.setting.edit')
{
$sMenuController = 'admincp.setting';
}
if ($this->_getMenuName() !== null)
{
$sMenuController = $this->_getMenuName();
}
foreach ($aMenus as $sKey => $aSubMenus)
{
开发者ID:hoanghd, 项目名称:tools, 代码行数:67, 代码来源:index.class.php
示例17: getStaticVersion
/**
* Gets a 32 string character of the version of the static files
* on the site.
*
* @return string 32 character MD5 sum
*/
public function getStaticVersion()
{
$sVersion = md5((defined('PHPFOX_NO_CSS_CACHE') && PHPFOX_NO_CSS_CACHE || $this->_bIsTestMode === true ? PHPFOX_TIME : PhpFox::getId() . Phpfox::getBuild()) . (defined('PHPFOX_INSTALLER') ? '' : '-' . Phpfox::getParam('core.css_edit_id') . Phpfox::getBuild() . '-' . $this->_sThemeFolder . '-' . $this->_sStyleFolder));
($sPlugin = Phpfox_Plugin::get('template_getstaticversion')) ? eval($sPlugin) : false;
return $sVersion;
}
开发者ID:auzunov, 项目名称:phpfox, 代码行数:12, 代码来源:template.class.php
示例18: run
public function run()
{
$oRequest = Phpfox::getLib('request');
$db = PhpFox::getLib('database');
// Limit per page, start offset at zero
$iOffset = (int) $oRequest->get('offset', 0);
$sAction = $oRequest->get('Confirm', 'Start');
$iLimit = 500;
$aPrivacySettings = array();
//Set form token for version 3xx
if ((int) substr(Phpfox::getVersion(), 0, 1) < 3) {
$s1 = 'v2_no_token';
$s2 = 'v2_no_token';
} else {
$s1 = Phpfox::getTokenName();
$s2 = Phpfox::getService('log.session')->getToken();
}
// Run only if Userpresets Module is present
if (!phpFox::isModule('Userpresets')) {
die('User Preset addon must be present.');
}
// Set profile privacy based upon admincp setting
switch (Phpfox::getParam('user.on_register_privacy_setting')) {
case 'network':
$aPrivacySettings['profile.view_profile'] = '1';
break;
case 'friends_only':
$aPrivacySettings['profile.view_profile'] = '2';
break;
case 'no_one':
$aPrivacySettings['profile.view_profile'] = '4';
break;
default:
break;
}
// Get Userpreset parameters and build the privacy array
$aSettings = Phpfox::getService('admincp.setting')->search("product_id = 'Preset_New_User'");
foreach ($aSettings as $aSetting) {
$aParts = explode('__', $aSetting['var_name']);
if (phpFox::isModule($aParts[0])) {
$sUserPrivacy = str_replace('__', '.', $aSetting['var_name']);
$sGetParam = $aSetting['module_id'] . '.' . $aSetting['var_name'];
if ($aSetting['type_id'] == 'drop') {
$iPrivacySetting = NULL;
$iPrivacySetting = Phpfox::getParam($sGetParam);
if (isset($iPrivacySetting) && (int) $iPrivacySetting > 0) {
$aPrivacySettings[$sUserPrivacy] = $iPrivacySetting;
}
}
}
}
if ($sAction == 'Start') {
//add confirm form
$iTotUsers = $db->select('COUNT(*)')->from(Phpfox::getT('user'))->where('view_id = 0')->execute('getField');
$iTotPrivacy = $db->select('COUNT(*)')->from(Phpfox::getT('user_privacy'))->execute('getField');
$iTotNewPrivacy = count($aPrivacySettings);
$sWarn = 'This action will remove approximately ' . $iTotPrivacy . ' Records from ' . $iTotUsers . ' users from the user privacy table and
replace them with approximately ' . $iTotUsers * $iTotNewPrivacy . ' records. The new settings will be taken from the parameters that
you have set in the New User Privacy Setting Module. <br /><br />
This will not affect the operation of PhpFox but it will nullify any privacy
settings that your users have set in favor of the ones that you will be setting.
<br /><br />Do you want to continue?';
echo '
<div style="width:500px;margin:0px auto;text-align:left;padding:15px;border:1px solid #333;background-color:#eee;">
<div> ' . $sWarn . ' </div>
<form method="POST" name="form" id="form" action="http://' . Phpfox::getParam('core.host') . '/tools/dbfixPRIVACY.php">
<div><input type="hidden" name="' . $s1 . '[security_token]" value="' . $s2 . '" /></div>
<div style="width:400px;margin:0px auto;text-align:right;padding:15px;background-color:#eee;">
<input type=hidden name="offset" value="0">
<input type="submit" name="Confirm" value="Continue" />
<input type="submit" name="Confirm" value="Cancel" />
</div>
</form>
</div>';
}
if ($sAction == 'Cancel') {
die("No Records Changed");
}
// Empty privacy table at start of batch
if ($sAction == 'Continue' && $iOffset == 0) {
$db->query('TRUNCATE ' . Phpfox::getT('user_privacy'));
echo 'Processing records from ' . $iOffset . ' to ' . ($iOffset + $iLimit) . '<br />';
}
if ($sAction == 'Continue') {
// For each user
$aRows = $this->database()->select('user_id')->from(Phpfox::getT('user'))->order('user_id')->where('view_id = 0')->limit($iOffset, $iLimit)->execute('getSlaveRows');
$iCount = 0;
foreach ($aRows as $row) {
++$iCount;
$userid = $row['user_id'];
$s = '';
foreach ($aPrivacySettings as $k => $v) {
$s .= "({$userid}, '{$k}',{$v}),";
}
$s = 'INSERT INTO ' . Phpfox::getT('user_privacy') . " (`user_id`, `user_privacy`, `user_value`) VALUES" . substr($s, 0, -1);
$db->query($s);
}
// Did do a full batch?
if ($iCount == $iLimit) {
// Get another batch
//.........这里部分代码省略.........
开发者ID:hsz-webdev, 项目名称:phpFox-Webcode, 代码行数:101, 代码来源:dbfixPRIVACY.php
bradtraversy/iweather: Ionic 3 mobile weather app
阅读:1586| 2022-08-30
joaomh/curso-de-matlab
阅读:1149| 2022-08-17
魔兽世界怀旧服已经开启两个多月了,但作为一个猎人玩家,抓到“断牙”,已经成为了一
阅读:1003| 2022-11-06
rugk/mastodon-simplified-federation: Simplifies following and interacting with r
阅读:1081| 2022-08-17
tpoechtrager/cctools-port: Apple cctools port for Linux and *BSD
阅读:480| 2022-08-15
Tangshitao/Dense-Scene-Matching: Learning Camera Localization via Dense Scene Ma
阅读:764| 2022-08-16
”云”或者’云滴‘是云模型的基本单元,所谓云是指在其论域上的一个分布,可以用联合
阅读:545| 2022-07-18
Vulnerability in the Oracle Solaris product of Oracle Systems (component: SMB Se
阅读:466| 2022-07-29
相信不少果粉在对自己的设备进行某些操作时,都会碰到Respring,但这个 Respring 到底
阅读:361| 2022-11-06
Windows Hyper-V Information Disclosure Vulnerability. This CVE ID is unique from
阅读:936| 2022-07-29
请发表评论