本文整理汇总了PHP中OC_Appconfig类的典型用法代码示例。如果您正苦于以下问题:PHP OC_Appconfig类的具体用法?PHP OC_Appconfig怎么用?PHP OC_Appconfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OC_Appconfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setExecutionType
/**
* sets the background jobs execution type
* @param string $type execution type
* @return false|null
*
* This method sets the execution type of the background jobs. Possible types
* are "none", "ajax", "webcron", "cron"
*/
public static function setExecutionType($type)
{
if (!in_array($type, array('none', 'ajax', 'webcron', 'cron'))) {
return false;
}
return OC_Appconfig::setValue('core', 'backgroundjobs_mode', $type);
}
示例2: check
/**
* Check if a new version is available
*/
public static function check()
{
OC_Appconfig::setValue('core', 'lastupdatedat', microtime(true));
if (OC_Appconfig::getValue('core', 'installedat', '') == '') {
OC_Appconfig::setValue('core', 'installedat', microtime(true));
}
$updaterurl = 'http://apps.owncloud.com/updater.php';
$version = OC_Util::getVersion();
$version['installed'] = OC_Appconfig::getValue('core', 'installedat');
$version['updated'] = OC_Appconfig::getValue('core', 'lastupdatedat');
$version['updatechannel'] = 'stable';
$version['edition'] = OC_Util::getEditionString();
$versionstring = implode('x', $version);
//fetch xml data from updater
$url = $updaterurl . '?version=' . $versionstring;
$xml = @file_get_contents($url);
if ($xml == FALSE) {
return array();
}
$data = @simplexml_load_string($xml);
$tmp = array();
$tmp['version'] = $data->version;
$tmp['versionstring'] = $data->versionstring;
$tmp['url'] = $data->url;
$tmp['web'] = $data->web;
return $tmp;
}
示例3: check
/**
* Check if a new version is available
*/
public static function check()
{
OC_Appconfig::setValue('core', 'lastupdatedat', microtime(true));
if (OC_Appconfig::getValue('core', 'installedat', '') == '') {
OC_Appconfig::setValue('core', 'installedat', microtime(true));
}
$updaterurl = 'http://apps.owncloud.com/updater.php';
$version = OC_Util::getVersion();
$version['installed'] = OC_Appconfig::getValue('core', 'installedat');
$version['updated'] = OC_Appconfig::getValue('core', 'lastupdatedat');
$version['updatechannel'] = 'stable';
$version['edition'] = OC_Util::getEditionString();
$versionstring = implode('x', $version);
//fetch xml data from updater
$url = $updaterurl . '?version=' . $versionstring;
// set a sensible timeout of 10 sec to stay responsive even if the update server is down.
$ctx = stream_context_create(array('http' => array('timeout' => 10)));
$xml = @file_get_contents($url, 0, $ctx);
if ($xml == false) {
return array();
}
$data = @simplexml_load_string($xml);
$tmp = array();
$tmp['version'] = $data->version;
$tmp['versionstring'] = $data->versionstring;
$tmp['url'] = $data->url;
$tmp['web'] = $data->web;
return $tmp;
}
示例4: check
/**
* Check if a new version is available
* @param string $updaterUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
* @return array | bool
*/
public function check($updaterUrl)
{
// Look up the cache - it is invalidated all 30 minutes
if (\OC_Appconfig::getValue('core', 'lastupdatedat') + 1800 > time()) {
return json_decode(\OC_Appconfig::getValue('core', 'lastupdateResult'), true);
}
\OC_Appconfig::setValue('core', 'lastupdatedat', time());
if (\OC_Appconfig::getValue('core', 'installedat', '') == '') {
\OC_Appconfig::setValue('core', 'installedat', microtime(true));
}
$version = \OC_Util::getVersion();
$version['installed'] = \OC_Appconfig::getValue('core', 'installedat');
$version['updated'] = \OC_Appconfig::getValue('core', 'lastupdatedat');
$version['updatechannel'] = \OC_Util::getChannel();
$version['edition'] = \OC_Util::getEditionString();
$version['build'] = \OC_Util::getBuild();
$versionString = implode('x', $version);
//fetch xml data from updater
$url = $updaterUrl . '?version=' . $versionString;
// set a sensible timeout of 10 sec to stay responsive even if the update server is down.
$ctx = stream_context_create(array('http' => array('timeout' => 10)));
$xml = @file_get_contents($url, 0, $ctx);
if ($xml == false) {
return array();
}
$data = @simplexml_load_string($xml);
$tmp = array();
$tmp['version'] = $data->version;
$tmp['versionstring'] = $data->versionstring;
$tmp['url'] = $data->url;
$tmp['web'] = $data->web;
// Cache the result
\OC_Appconfig::setValue('core', 'lastupdateResult', json_encode($data));
return $tmp;
}
示例5: getUser
/**
* gets user info
*/
public static function getUser($parameters)
{
$userid = $parameters['userid'];
$return = array();
$return['email'] = OC_Preferences::getValue($userid, 'settings', 'email', '');
$default = OC_Appconfig::getValue('files', 'default_quota', 0);
$return['quota'] = OC_Preferences::getValue($userid, 'files', 'quota', $default);
return $return;
}
示例6: __construct
function __construct()
{
$this->ldap_host = OC_Appconfig::getValue('user_ldap', 'ldap_host', '');
$this->ldap_port = OC_Appconfig::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT);
$this->ldap_dn = OC_Appconfig::getValue('user_ldap', 'ldap_dn', '');
$this->ldap_password = OC_Appconfig::getValue('user_ldap', 'ldap_password', '');
$this->ldap_base = OC_Appconfig::getValue('user_ldap', 'ldap_base', '');
$this->ldap_filter = OC_Appconfig::getValue('user_ldap', 'ldap_filter', '');
if (!empty($this->ldap_host) && !empty($this->ldap_port) && !empty($this->ldap_dn) && !empty($this->ldap_password) && !empty($this->ldap_base) && !empty($this->ldap_filter)) {
$this->configured = true;
}
}
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:12,代码来源:owncloud_apps_user_ldap_user_ldap.php
示例7: checkNext
public static function checkNext()
{
// check both 1 file and 1 folder, this way new files are detected quicker because there are less folders than files usually
$previousFile = \OC_Appconfig::getValue('files', 'backgroundwatcher_previous_file', 0);
$previousFolder = \OC_Appconfig::getValue('files', 'backgroundwatcher_previous_folder', 0);
$nextFile = self::getNextFileId($previousFile, false);
$nextFolder = self::getNextFileId($previousFolder, true);
\OC_Appconfig::setValue('files', 'backgroundwatcher_previous_file', $nextFile);
\OC_Appconfig::setValue('files', 'backgroundwatcher_previous_folder', $nextFolder);
if ($nextFile > 0) {
self::checkUpdate($nextFile);
}
if ($nextFolder > 0) {
self::checkUpdate($nextFolder);
}
}
示例8: __construct
function __construct()
{
$this->db_conn = false;
$db_host = OC_Appconfig::getValue('user_django_auth', 'django_auth_db_host', '');
$db_name = OC_Appconfig::getValue('user_django_auth', 'django_auth_db_name', '');
$db_driver = OC_Appconfig::getValue('user_django_auth', 'django_auth_db_driver', 'mysql');
$db_user = OC_Appconfig::getValue('user_django_auth', 'django_auth_db_user', '');
$db_password = OC_Appconfig::getValue('user_django_auth', 'django_auth_db_password', '');
$dsn = "{$db_driver}:host={$db_host};dbname={$db_name}";
try {
$this->db = new PDO($dsn, $db_user, $db_password);
$this->db_conn = true;
} catch (PDOException $e) {
OC_Log::write('OC_User_Django_Auth', 'OC_User_Django_Auth, Failed to connect to django auth database: ' . $e->getMessage(), OC_Log::ERROR);
}
return false;
}
示例9: __construct
public function __construct()
{
$this->pwauth_bin_path = OC_Appconfig::getValue('user_pwauth', 'pwauth_path', OC_USER_BACKEND_PWAUTH_PATH);
$list = explode(";", OC_Appconfig::getValue('user_pwauth', 'uid_list', OC_USER_BACKEND_PWAUTH_UID_LIST));
$r = array();
foreach ($list as $entry) {
if (strpos($entry, "-") === FALSE) {
$r[] = $entry;
} else {
$range = explode("-", $entry);
if ($range[0] < 0) {
$range[0] = 0;
}
if ($range[1] < $range[0]) {
$range[1] = $range[0];
}
for ($i = $range[0]; $i <= $range[1]; $i++) {
$r[] = $i;
}
}
}
$this->pwauth_uid_list = $r;
}
示例10: __construct
/**
* @brief if session is started, check if ownCloud key pair is set up, if not create it
* @param \OC_FilesystemView $view
*
* @note The ownCloud key pair is used to allow public link sharing even if encryption is enabled
*/
public function __construct($view)
{
$this->view = $view;
if (!$this->view->is_dir('owncloud_private_key')) {
$this->view->mkdir('owncloud_private_key');
}
$publicShareKeyId = \OC_Appconfig::getValue('files_encryption', 'publicShareKeyId');
if ($publicShareKeyId === null) {
$publicShareKeyId = 'pubShare_' . substr(md5(time()), 0, 8);
\OC_Appconfig::setValue('files_encryption', 'publicShareKeyId', $publicShareKeyId);
}
if (!$this->view->file_exists("/public-keys/" . $publicShareKeyId . ".public.key") || !$this->view->file_exists("/owncloud_private_key/" . $publicShareKeyId . ".private.key")) {
$keypair = Crypt::createKeypair();
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
// Save public key
if (!$view->is_dir('/public-keys')) {
$view->mkdir('/public-keys');
}
$this->view->file_put_contents('/public-keys/' . $publicShareKeyId . '.public.key', $keypair['publicKey']);
// Encrypt private key empty passphrase
$encryptedPrivateKey = Crypt::symmetricEncryptFileContent($keypair['privateKey'], '');
// Save private key
$this->view->file_put_contents('/owncloud_private_key/' . $publicShareKeyId . '.private.key', $encryptedPrivateKey);
\OC_FileProxy::$enabled = $proxyStatus;
}
if (\OCA\Encryption\Helper::isPublicAccess()) {
// Disable encryption proxy to prevent recursive calls
$proxyStatus = \OC_FileProxy::$enabled;
\OC_FileProxy::$enabled = false;
$encryptedKey = $this->view->file_get_contents('/owncloud_private_key/' . $publicShareKeyId . '.private.key');
$privateKey = Crypt::decryptPrivateKey($encryptedKey, '');
$this->setPublicSharePrivateKey($privateKey);
\OC_FileProxy::$enabled = $proxyStatus;
}
}
示例11: getParams
public function getParams()
{
$array = array();
foreach ($this->params as $key => $param) {
$array[$param] = OC_Appconfig::getValue('user_wordpress', $param, '');
}
if (empty($array['wordpress_db_host'])) {
$array['wordpress_db_host'] = OC_Config::getValue("dbhost", "");
}
if (empty($array['wordpress_db_name'])) {
$array['wordpress_db_name'] = OC_Config::getValue("dbname", "owncloud");
}
if (empty($array['wordpress_db_user'])) {
$array['wordpress_db_user'] = OC_Config::getValue("dbuser", "");
}
if (empty($array['wordpress_db_password'])) {
$array['wordpress_db_password'] = OC_Config::getValue("dbpassword", "");
}
if (empty($array['wordpress_have_to_be_logged'])) {
$array['wordpress_have_to_be_logged'] = '0';
OC_Appconfig::setValue('user_wordpress', 'wordpress_have_to_be_logged', '0');
}
return $array;
}
示例12: trim
if ($param === 'rcHost') {
if ($_POST[$param] == '' || strlen($_POST[$param]) > 3) {
OCP\Config::setAppValue('roundcube', $param, $_POST[$param]);
}
} else {
if ($param === 'maildir') {
$maildir = $_POST[$param];
if (substr($maildir, -1) != '/') {
$maildir .= '/';
}
OCP\Config::setAppValue('roundcube', $param, $maildir);
} else {
if ($param == 'rcRefreshInterval') {
$refresh = trim($_POST[$param]);
if ($refresh == '') {
OC_Appconfig::deleteKey('roundcube', $param);
} else {
if (!is_numeric($refresh)) {
OC_JSON::error(array("data" => array("message" => $l->t("Refresh interval '%s' is not a number.", array($refresh)))));
return false;
} else {
OCP\Config::setAppValue('roundcube', $param, $refresh);
}
}
} else {
OCP\Config::setAppValue('roundcube', $param, $_POST[$param]);
}
}
}
}
} else {
示例13: shareWithGroupMembersOnly
/**
* check if user can only share with group members
* @return bool
*/
public static function shareWithGroupMembersOnly()
{
$value = \OC_Appconfig::getValue('core', 'shareapi_only_share_with_group_members', 'no');
return $value === 'yes' ? true : false;
}
示例14: isset
<?php
/**
* ownCloud - Updater plugin
*
* @author Victor Dubiniuk
* @copyright 2012-2013 Victor Dubiniuk victor.dubiniuk@gmail.com
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
namespace OCA\Updater;
\OCP\User::checkAdminUser();
\OCP\Util::addScript(App::APP_ID, '3rdparty/angular');
\OCP\Util::addScript(App::APP_ID, 'app');
\OCP\Util::addScript(App::APP_ID, 'controllers');
\OCP\Util::addStyle(App::APP_ID, 'updater');
if (!@file_exists(App::getBackupBase())) {
Helper::mkdir(App::getBackupBase());
}
$data = App::getFeed();
$isNewVersionAvailable = isset($data['version']) && $data['version'] != '' && $data['version'] !== array();
$tmpl = new \OCP\Template(App::APP_ID, 'admin');
$lastCheck = \OC_Appconfig::getValue('core', 'lastupdatedat');
$tmpl->assign('checkedAt', \OCP\Util::formatDate($lastCheck));
$tmpl->assign('isNewVersionAvailable', $isNewVersionAvailable ? 'true' : 'false');
$tmpl->assign('channels', Channel::getChannels());
$tmpl->assign('currentChannel', Channel::getCurrentChannel());
$tmpl->assign('version', isset($data['versionstring']) ? $data['versionstring'] : '');
return $tmpl->fetchPage();
示例15:
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Documents;
\OCP\User::checkLoggedIn();
\OCP\JSON::checkAppEnabled('documents');
\OCP\App::setActiveNavigationEntry('documents_index');
\OCP\Util::addStyle('documents', 'style');
\OCP\Util::addStyle('documents', '3rdparty/webodf/dojo-app');
\OCP\Util::addScript('documents', 'documents');
\OCP\Util::addScript('files', 'file-upload');
\OCP\Util::addScript('files', 'jquery.iframe-transport');
\OCP\Util::addScript('files', 'jquery.fileupload');
$tmpl = new \OCP\Template('documents', 'documents', 'user');
$previewsEnabled = \OC::$server->getConfig()->getSystemValue('enable_previews', true);
$unstable = \OCP\Config::getAppValue('documents', 'unstable', 'false');
$maxUploadFilesize = \OCP\Util::maxUploadFilesize("/");
$savePath = \OCP\Config::getUserValue(\OCP\User::getUser(), 'documents', 'save_path', '/');
$tmpl->assign('enable_previews', $previewsEnabled);
$tmpl->assign('useUnstable', $unstable);
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', \OCP\Util::humanFileSize($maxUploadFilesize));
$tmpl->assign('savePath', $savePath);
$tmpl->assign("allowShareWithLink", \OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes'));
$tmpl->printPage();