public function __construct()
 {
     $this->sspPath = OCP\Config::getAppValue('user_saml', 'saml_ssp_path', '');
     $this->spSource = OCP\Config::getAppValue('user_saml', 'saml_sp_source', '');
     $this->forceLogin = OCP\Config::getAppValue('user_saml', 'saml_force_saml_login', false);
     $this->autocreate = OCP\Config::getAppValue('user_saml', 'saml_autocreate', false);
     $this->updateUserData = OCP\Config::getAppValue('user_saml', 'saml_update_user_data', false);
     $this->defaultGroup = OCP\Config::getAppValue('user_saml', 'saml_default_group', '');
     $this->protectedGroups = explode(',', preg_replace('/\\s+/', '', OCP\Config::getAppValue('user_saml', 'saml_protected_groups', '')));
     $this->usernameMapping = explode(',', preg_replace('/\\s+/', '', OCP\Config::getAppValue('user_saml', 'saml_username_mapping', '')));
     $this->mailMapping = explode(',', preg_replace('/\\s+/', '', OCP\Config::getAppValue('user_saml', 'saml_email_mapping', '')));
     $this->displayNameMapping = explode(',', preg_replace('/\\s+/', '', OCP\Config::getAppValue('user_saml', 'saml_displayname_mapping', '')));
     $this->quotaMapping = explode(',', preg_replace('/\\s+/', '', OCP\Config::getAppValue('user_saml', 'saml_quota_mapping', '')));
     $this->defaultQuota = OCP\Config::getAppValue('user_saml', 'saml_default_quota', '');
     $this->groupMapping = explode(',', preg_replace('/\\s+/', '', OCP\Config::getAppValue('user_saml', 'saml_group_mapping', '')));
     if (!empty($this->sspPath) && !empty($this->spSource)) {
         include_once $this->sspPath . "/lib/_autoload.php";
         $this->auth = new SimpleSAML_Auth_Simple($this->spSource);
         if (isset($_COOKIE["user_saml_logged_in"]) and $_COOKIE["user_saml_logged_in"] and !$this->auth->isAuthenticated()) {
             unset($_COOKIE["user_saml_logged_in"]);
             setcookie("user_saml_logged_in", null, -1);
             OCP\User::logout();
         }
     }
 }
Esempio n. 2
0
 public function __construct()
 {
     // These are default values for the first login and should be changed via GUI
     $CAS_HOSTNAME = 'your.domain.org';
     $CAS_PORT = '443';
     $CAS_PATH = '/cas';
     $this->autocreate = OCP\Config::getAppValue('user_cas', 'cas_autocreate', true);
     $this->updateUserData = OCP\Config::getAppValue('user_cas', 'cas_update_user_data', true);
     $this->defaultGroup = OCP\Config::getAppValue('user_cas', 'cas_default_group', '');
     $this->protectedGroups = explode(',', str_replace(' ', '', OCP\Config::getAppValue('user_cas', 'cas_protected_groups', '')));
     $this->mailMapping = OCP\Config::getAppValue('user_cas', 'cas_email_mapping', '');
     $this->displayNameMapping = OCP\Config::getAppValue('user_cas', 'cas_displayName_mapping', '');
     $this->groupMapping = OCP\Config::getAppValue('user_cas', 'cas_group_mapping', '');
     $casVersion = OCP\Config::getAppValue('user_cas', 'cas_server_version', '2.0');
     $casHostname = OCP\Config::getAppValue('user_cas', 'cas_server_hostname', $CAS_HOSTNAME);
     $casPort = OCP\Config::getAppValue('user_cas', 'cas_server_port', $CAS_PORT);
     $casPath = OCP\Config::getAppValue('user_cas', 'cas_server_path', $CAS_PATH);
     $casCertPath = OCP\Config::getAppValue('user_cas', 'cas_cert_path', '');
     global $initialized_cas;
     if (!$initialized_cas) {
         phpCAS::client($casVersion, $casHostname, (int) $casPort, $casPath, false);
         if (!empty($casCertPath)) {
             phpCAS::setCasServerCACert($casCertPath);
         } else {
             phpCAS::setNoCasServerValidation();
         }
         $initialized_cas = true;
     }
 }
 public function __construct()
 {
     $this->ldapUserFilter = OCP\Config::getAppValue('user_ldap', 'ldap_userlist_filter', '(objectClass=posixAccount)');
     $this->ldapQuotaAttribute = OCP\Config::getAppValue('user_ldap', 'ldap_quota_attr', '');
     $this->ldapQuotaDefault = OCP\Config::getAppValue('user_ldap', 'ldap_quota_def', '');
     $this->ldapEmailAttribute = OCP\Config::getAppValue('user_ldap', 'ldap_email_attr', '');
 }
Esempio n. 4
0
 public static function getSites()
 {
     if (($sites = json_decode(OCP\Config::getAppValue("external", "sites", ''))) != NULL) {
         return $sites;
     }
     return array();
 }
Esempio n. 5
0
function generateUrl() {
	//$newHost = "https://nowsci.com/s/";
	$host = OCP\Config::getAppValue('shorten', 'host', '');
	$type = OCP\Config::getAppValue('shorten', 'type', '');
	$api = OCP\Config::getAppValue('shorten', 'api', '');
	$curUrl = $_POST['curUrl'];
	$ret = "";
	if (isset($type) && ($type == "" || $type == "internal")) {
		if ($host == "" || startsWith($curUrl, $host)) {
			$ret = $curUrl;
		} else {
			$shortcode = getShortcode($curUrl);
			$newUrl = $host."?".$shortcode;
			$ret = $newUrl;
		}
	} elseif ($type == "googl") {
		if ($api && $api != "") {
			require_once __DIR__ . '/../lib/class.googl.php';
			$googl = new googl($api);
			$short = $googl->s($curUrl);
			$ret = $short;
		} else {
			$ret = $curUrl;
		}
	} else {
		$ret = $curUrl;
	}
	return $ret;
}
Esempio n. 6
0
 public static function initialized_php_cas()
 {
     if (!self::$_initialized_php_cas) {
         $casVersion = OCP\Config::getAppValue('user_cas', 'cas_server_version', '2.0');
         $casHostname = OCP\Config::getAppValue('user_cas', 'cas_server_hostname', $_SERVER['SERVER_NAME']);
         $casPort = OCP\Config::getAppValue('user_cas', 'cas_server_port', 443);
         $casPath = OCP\Config::getAppValue('user_cas', 'cas_server_path', '/cas');
         $casDebugFile = OCP\Config::getAppValue('user_cas', 'cas_debug_file', '');
         $casCertPath = OCP\Config::getAppValue('user_cas', 'cas_cert_path', '');
         $php_cas_path = OCP\Config::getAppValue('user_cas', 'cas_php_cas_path', 'CAS.php');
         if (!class_exists('phpCAS')) {
             if (empty($php_cas_path)) {
                 $php_cas_path = 'CAS.php';
             }
             OC_Log::write('cas', "Try to load phpCAS library ({$php_cas_path})", OC_Log::DEBUG);
             include_once $php_cas_path;
             if (!class_exists('phpCAS')) {
                 OC_Log::write('cas', 'Fail to load phpCAS library !', OC_Log::ERROR);
                 return false;
             }
         }
         if ($casDebugFile !== '') {
             phpCAS::setDebug($casDebugFile);
         }
         phpCAS::client($casVersion, $casHostname, (int) $casPort, $casPath, false);
         if (!empty($casCertPath)) {
             phpCAS::setCasServerCACert($casCertPath);
         } else {
             phpCAS::setNoCasServerValidation();
         }
         self::$_initialized_php_cas = true;
     }
     return self::$_initialized_php_cas;
 }
 public function __construct()
 {
     $this->ldapGroupFilter = OCP\Config::getAppValue('user_ldap', 'ldap_group_filter', '(objectClass=posixGroup)');
     $this->ldapGroupMemberAssocAttr = OCP\Config::getAppValue('user_ldap', 'ldap_group_member_assoc_attribute', 'uniqueMember');
     if (!empty($this->ldapGroupFilter) && !empty($this->ldapGroupMemberAssocAttr)) {
         $this->configured = true;
     }
 }
Esempio n. 8
0
 public function __construct()
 {
     $this->sspPath = OCP\Config::getAppValue('user_saml', 'saml_ssp_path', '');
     $this->spSource = OCP\Config::getAppValue('user_saml', 'saml_sp_source', '');
     $this->autocreate = OCP\Config::getAppValue('user_saml', 'saml_autocreate', false);
     $this->updateUserData = OCP\Config::getAppValue('user_saml', 'saml_update_user_data', false);
     $this->defaultGroup = OCP\Config::getAppValue('user_saml', 'saml_default_group', '');
     $this->protectedGroups = explode(',', str_replace(' ', '', OCP\Config::getAppValue('user_saml', 'saml_protected_groups', '')));
     $this->usernameMapping = OCP\Config::getAppValue('user_saml', 'saml_username_mapping', '');
     $this->mailMapping = OCP\Config::getAppValue('user_saml', 'saml_email_mapping', '');
     $this->groupMapping = OCP\Config::getAppValue('user_saml', 'saml_group_mapping', '');
     include_once $this->sspPath . "/lib/_autoload.php";
     $this->auth = new SimpleSAML_Auth_Simple($this->spSource);
 }
Esempio n. 9
0
/**
 * Check if login should be enforced using user_cas
 */
function shouldEnforceAuthentication()
{
    if (OC::$CLI) {
        return false;
    }
    if (OCP\Config::getAppValue('user_cas', 'cas_force_login', false) !== 'on') {
        return false;
    }
    if (OCP\User::isLoggedIn() || isset($_GET['admin_login'])) {
        return false;
    }
    $script = basename($_SERVER['SCRIPT_FILENAME']);
    return !in_array($script, array('cron.php', 'public.php', 'remote.php', 'status.php'));
}
Esempio n. 10
0
 /**
  * Gets information about association identified by $handle
  * Returns true if given association found and not expired and false
  * otherwise
  *
  * @param string $handle assiciation handle
  * @param string &$macFunc HMAC function (sha1 or sha256)
  * @param string &$secret shared secret
  * @param string &$expires expiration UNIX time
  * @return bool
  */
 public function getAssociation($handle, &$macFunc, &$secret, &$expires)
 {
     $name = 'assoc_' . md5($handle);
     $data = OCP\Config::getAppValue('user_openid_provider', $name);
     if (!empty($data)) {
         list($storedHandle, $macFunc, $storedSecret, $expires) = unserialize($data);
         $secret = base64_decode($storedSecret);
         if ($handle === $storedHandle && $expires > time()) {
             return true;
         } else {
             $this->delAssociation($handle);
             return false;
         }
     }
     return false;
 }
 public static function changePassword($aParams)
 {
     if (isset($aParams['uid'], $aParams['password'])) {
         $sUser = $aParams['uid'];
         $sEmail = $sUser;
         $sPassword = $aParams['password'];
         $sUrl = trim(OCP\Config::getAppValue('rainloop', 'rainloop-url', ''));
         $sPath = trim(OCP\Config::getAppValue('rainloop', 'rainloop-path', ''));
         if ('' !== $sUrl && '' !== $sPath) {
             OCP\Util::writeLog('rainloop', 'rainloop|login: Setting new RainLoop password for ' . $sEmail, OCP\Util::DEBUG);
             $sPassword = self::encodePassword($sPassword, md5($sEmail));
             return OCP\Config::setUserValue($sUser, 'rainloop', 'rainloop-password', $sPassword);
         }
     }
     return false;
 }
Esempio n. 12
0
 public function setUp()
 {
     \OC_User::createUser(self::TEST_USER1, self::TEST_USER1);
     \OC_User::createUser(self::TEST_USER2, self::TEST_USER2);
     \OC_Group::createGroup(self::TEST_GROUP1);
     \OC_Group::addToGroup(self::TEST_USER1, self::TEST_GROUP1);
     \OC_Group::createGroup(self::TEST_GROUP2);
     \OC_Group::addToGroup(self::TEST_USER2, self::TEST_GROUP2);
     \OC_User::setUserId(self::TEST_USER1);
     $this->userHome = \OC_User::getHome(self::TEST_USER1);
     mkdir($this->userHome);
     $this->dataDir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/');
     $this->oldAllowedBackends = OCP\Config::getAppValue('files_external', 'user_mounting_backends', '');
     $this->allBackends = OC_Mount_Config::getBackends();
     OCP\Config::setAppValue('files_external', 'user_mounting_backends', implode(',', array_keys($this->allBackends)));
     OC_Mount_Config::$skipTest = true;
 }
Esempio n. 13
0
 public static function InitCAS()
 {
     if (!self::$_InitCAS) {
         $aliasName = OCP\Config::getAppValue('user_cas', 'cas_aliasName', '');
         $casVersion = OCP\Config::getAppValue('user_cas', 'cas_server_version', '2.0');
         $casHostname = OCP\Config::getAppValue('user_cas', 'cas_server_hostname', 'ident.domain.fr');
         $casPort = OCP\Config::getAppValue('user_cas', 'cas_server_port', '443');
         $casPath = OCP\Config::getAppValue('user_cas', 'cas_server_path', '/cas');
         phpCAS::client($casVersion, $casHostname, (int) $casPort, $casPath, false);
         if ($aliasName) {
             phpCAS::setFixedServiceURL($aliasName);
         }
         phpCAS::setNoCasServerValidation();
         self::$_InitCAS = true;
     }
     return self::$_InitCAS;
 }
Esempio n. 14
0
 /**
  * check if a file should be encrypted during write
  * @param string $path
  * @return bool
  */
 private static function shouldEncrypt($path)
 {
     if (is_null(self::$enableEncryption)) {
         self::$enableEncryption = OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true') == 'true';
     }
     if (!self::$enableEncryption) {
         return false;
     }
     if (is_null(self::$blackList)) {
         self::$blackList = explode(',', OCP\Config::getAppValue('files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
     }
     if (self::isEncrypted($path)) {
         return true;
     }
     $extension = substr($path, strrpos($path, '.') + 1);
     if (array_search($extension, self::$blackList) === false) {
         return true;
     }
 }
Esempio n. 15
0
 public function setUp()
 {
     $this->oldConfig = OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true');
     OCP\Config::setAppValue('files_encryption', 'enable_encryption', 'true');
     $this->oldKey = isset($_SESSION['enckey']) ? $_SESSION['enckey'] : null;
     //set testing key
     $_SESSION['enckey'] = md5(time());
     //clear all proxies and hooks so we can do clean testing
     OC_FileProxy::clearProxies();
     OC_Hook::clear('OC_Filesystem');
     //enable only the encryption hook
     OC_FileProxy::register(new OC_FileProxy_Encryption());
     //set up temporary storage
     OC_Filesystem::clearMounts();
     OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
     //set up the users home folder in the temp storage
     $rootView = new OC_FilesystemView('');
     $rootView->mkdir('/' . OC_User::getUser());
     $rootView->mkdir('/' . OC_User::getUser() . '/files');
 }
Esempio n. 16
0
                $GA_VALID_CHAR = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
                $UserTokenSeed = generateRandomString(8, 64, 8, $GA_VALID_CHAR);
                //}
            } else {
                $UserTokenSeed = $_POST["UserTokenSeed"];
            }
            //$UserTokenSeed="234567234567AZAZ";
            //$UserTokenSeed="Hello!";
            //~ if (OCP\Config::getAppValue('user_otp','TokenBase32Encode',true)){
            //~ $UserTokenSeed=bin2hex(base32_decode($UserTokenSeed));
            //~ }//else{
            //$UserTokenSeed=bin2hex($UserTokenSeed);
            $UserTokenSeed = bin2hex(base32_decode($UserTokenSeed));
            //$UserTokenSeed=bin2hex(base32_decode($UserTokenSeed));
            //echo $UserTokenSeed." / ".base32_encode($UserTokenSeed);exit;
            //echo $UserTokenSeed." / ".hex2bin($UserTokenSeed);exit;
            //}
            //echo "toto";
            $result = $mOtp->CreateUser($uid, OCP\Config::getAppValue('user_otp', 'UserPrefixPin', '0') ? 1 : 0, OCP\Config::getAppValue('user_otp', 'UserAlgorithm', 'TOTP'), $UserTokenSeed, $_POST["UserPin"], OCP\Config::getAppValue('user_otp', 'UserTokenNumberOfDigits', '6'), OCP\Config::getAppValue('user_otp', 'UserTokenTimeIntervalOrLastEvent', '30'));
            //var_dump($result);
            //exit;
            if ($result) {
                OCP\JSON::success(array("data" => array("message" => $l->t("OTP Changed"))));
            } else {
                OCP\JSON::error(array("data" => array("message" => $l->t("check apps folder rights"))));
            }
        } else {
            OCP\JSON::error(array("data" => array("message" => $l->t("Invalid request"))));
        }
    }
}
Esempio n. 17
0
<?php

/**
 * ownCloud - RainLoop mail plugin
 *
 * @author RainLoop Team
 * @copyright 2015 RainLoop Team
 *
 * https://github.com/RainLoop/owncloud
 */
OC::$CLASSPATH['OC_RainLoop_Helper'] = OC_App::getAppPath('rainloop') . '/lib/RainLoopHelper.php';
OCP\App::registerAdmin('rainloop', 'admin');
OCP\App::registerPersonal('rainloop', 'personal');
if (OCP\Config::getAppValue('rainloop', 'rainloop-autologin', false)) {
    OCP\Util::connectHook('OC_User', 'post_login', 'OC_RainLoop_Helper', 'login');
    OCP\Util::connectHook('OC_User', 'post_setPassword', 'OC_RainLoop_Helper', 'changePassword');
}
OCP\Util::connectHook('OC_User', 'logout', 'OC_RainLoop_Helper', 'logout');
OCP\Util::addScript('rainloop', 'rainloop');
OCP\App::addNavigationEntry(array('id' => 'rainloop_index', 'order' => 10, 'href' => OCP\Util::linkToRoute('rainloop_index'), 'icon' => OCP\Util::imagePath('rainloop', 'mail.png'), 'name' => 'Email'));
Esempio n. 18
0
<?php

/**
 * ownCloud - user_saml
 *
 * @author Sixto Martin <*****@*****.**>
 * @copyright 2012 Yaco Sistemas // CONFIA
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * 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/>.
 *
 */
$sspPath = OCP\Config::getAppValue('user_saml', 'saml_ssp_path', '');
$spSource = OCP\Config::getAppValue('user_saml', 'saml_sp_source', '');
$autocreate = OCP\Config::getAppValue('user_saml', 'saml_autocreate', false);
if (!empty($sspPath) && !empty($spSource)) {
    include_once $sspPath . "/lib/_autoload.php";
    $auth = new SimpleSAML_Auth_Simple($spSource);
    $auth->requireAuth();
}
Esempio n. 19
0
 * 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/>.
 *
 */
OC_Util::checkAdminUser();
$params = array('cas_server_version', 'cas_server_hostname', 'cas_server_port', 'cas_server_path', 'cas_autocreate', 'cas_update_user_data', 'cas_protected_groups', 'cas_default_group', 'cas_email_mapping', 'cas_displayName_mapping', 'cas_group_mapping', 'cas_cert_path');
OCP\Util::addscript('user_minimalcas', 'settings');
if ($_POST) {
    // CSRF check
    OCP\JSON::callCheck();
    foreach ($params as $param) {
        if (isset($_POST[$param])) {
            OCP\Config::setAppValue('user_minimalcas', $param, $_POST[$param]);
        } elseif ('cas_autocreate' == $param) {
            // unchecked checkboxes are not included in the post paramters
            OCP\Config::setAppValue('user_minimalcas', $param, 0);
        } elseif ('cas_update_user_data' == $param) {
            OCP\Config::setAppValue('user_minimalcas', $param, 0);
        }
    }
}
// fill template
$tmpl = new OCP\Template('user_minimalcas', 'settings');
foreach ($params as $param) {
    $value = htmlentities(OCP\Config::getAppValue('user_minimalcas', $param, ''));
    $tmpl->assign($param, $value);
}
return $tmpl->fetchPage();
Esempio n. 20
0
<?php

// update from old app version, cleaning up old parameters
$installedVersion = OCP\Config::getAppValue('roundcube', 'installed_version');
if (version_compare($installedVersion, '2.6.0', '<')) {
    try {
        $sql = "UPDATE `*PREFIX*preferences` SET `configvalue` = REPLACE(`configvalue`,'\\n', char(10)) WHERE `appid` = 'roundcube' AND `configkey` = 'privateSSLKey'";
        $args = array(1);
        $query = \OCP\DB::prepare($sql);
        $result = $query->execute($args);
    } catch (Exception $e) {
        // We got an exception
        OCP\Util::writeLog('roundcube', 'update.php: ' . 'update error for fixing SSL keys ' . $e, OCP\Util::DEBUG);
    }
    try {
        $sql = 'DELETE FROM `*PREFIX*appconfig` WHERE appid = roundcube AND configkey = rcNoCronRefresh';
        $args = array(1);
        $query = \OCP\DB::prepare($sql);
        $result = $query->execute($args);
    } catch (Exception $e) {
        // We got an exception == table not found
        OCP\Util::writeLog('roundcube', 'update.php: ' . 'update error for removing rcNoCronRefresh. ' . $e, OCP\Util::DEBUG);
    }
    try {
        $sql = 'DELETE FROM `*PREFIX*appconfig` WHERE appid = roundcube AND configkey = encryptstring1';
        $args = array(1);
        $query = \OCP\DB::prepare($sql);
        $result = $query->execute($args);
    } catch (Exception $e) {
        // We got an exception == table not found
        OCP\Util::writeLog('roundcube', 'update.php: ' . 'update error for removing encryptstring1. ' . $e, OCP\Util::DEBUG);
Esempio n. 21
0
 if (version_compare($ocVersion, '5.0', '<')) {
     if (!function_exists('p')) {
         function p($string)
         {
             print OC_Util::sanitizeHTML($string);
         }
     }
 }
 require_once 'user_saml/user_saml.php';
 OCP\App::registerAdmin('user_saml', 'settings');
 // register user backend
 OC_User::useBackend('SAML');
 OC::$CLASSPATH['OC_USER_SAML_Hooks'] = 'user_saml/lib/hooks.php';
 OCP\Util::connectHook('OC_User', 'post_login', 'OC_USER_SAML_Hooks', 'post_login');
 OCP\Util::connectHook('OC_User', 'logout', 'OC_USER_SAML_Hooks', 'logout');
 $forceLogin = OCP\Config::getAppValue('user_saml', 'saml_force_saml_login', false);
 if (isset($_GET['app']) && $_GET['app'] == 'user_saml' || !OCP\User::isLoggedIn() && $forceLogin && !isset($_GET['admin_login'])) {
     require_once 'user_saml/auth.php';
     if (!OC_User::login('', '')) {
         $error = true;
         OC_Log::write('saml', 'Error trying to authenticate the user', OC_Log::DEBUG);
     }
     if (isset($_GET["linktoapp"])) {
         $path = OC::$WEBROOT . '/?app=' . $_GET["linktoapp"];
         if (isset($_GET["linktoargs"])) {
             $path .= '&' . urldecode($_GET["linktoargs"]);
         }
         header('Location: ' . $path);
         exit;
     }
     OC::$REQUESTEDAPP = '';
Esempio n. 22
0
<?php

OCP\User::checkAdminUser();
$tmpl = new OCP\Template('ownmnote', 'admin');
$tmpl->assign('folder', OCP\Config::getAppValue('ownmnote', 'folder', 'Notes'));
$tmpl->assign('disableAnnouncement', OCP\Config::getAppValue('ownmnote', 'disableAnnouncement', ''));
return $tmpl->fetchPage();
Esempio n. 23
0
		<input type="hidden" name="requesttoken" value="<?php 
    echo $_['requesttoken'];
    ?>
" id="requesttoken"> 
		<input type="hidden" name="appname" value="roundcube">
		<fieldset class="<?php 
    echo $cfgClass;
    ?>
" id="roundcube">
		<h2>
			<?php 
    p($l->t('RoundCube Mailaccount'));
    ?>
		</h2>
		<?php 
    $enable_auto_login = OCP\Config::getAppValue('roundcube', 'autoLogin', false);
    if (!$enable_auto_login) {
        $username = OCP\User::getUser();
        $privKey = OC_RoundCube_App::getPrivateKey($username, false);
        foreach ($mail_userdata_entries as $mail_userdata) {
            $mail_username = OC_RoundCube_App::decryptMyEntry($mail_userdata['mail_user'], $privKey);
            $mail_password = OC_RoundCube_App::decryptMyEntry($mail_userdata['mail_password'], $privKey);
            // TODO use template and add button for adding entries
            ?>
				<input type="text" id="rc_mail_username" name="rc_mail_username"
					value="<?php 
            echo $mail_username;
            ?>
" placeholder="<?php 
            p($l->t('Email Login Name'));
            ?>
Esempio n. 24
0
 /**
  * Get details on each of the external storage backends, used for the mount config UI
  * Some backends are not available as a personal backend, f.e. Local and such that have
  * been disabled by the admin.
  *
  * If a custom UI is needed, add the key 'custom' and a javascript file with that name will be loaded
  * If the configuration parameter should be secret, add a '*' to the beginning of the value
  * If the configuration parameter is a boolean, add a '!' to the beginning of the value
  * If the configuration parameter is optional, add a '&' to the beginning of the value
  * If the configuration parameter is hidden, add a '#' to the beginning of the value
  * @return array
  */
 public static function getPersonalBackends()
 {
     // Check whether the user has permissions to add personal storage backends
     // return an empty array if this is not the case
     if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') !== 'yes') {
         return array();
     }
     $backEnds = self::getBackends();
     // Remove local storage and other disabled storages
     unset($backEnds['\\OC\\Files\\Storage\\Local']);
     $allowedBackEnds = explode(',', OCP\Config::getAppValue('files_external', 'user_mounting_backends', ''));
     foreach ($backEnds as $backend => $null) {
         if (!in_array($backend, $allowedBackEnds)) {
             unset($backEnds[$backend]);
         }
     }
     return $backEnds;
 }
Esempio n. 25
0
 *
 */
OC_Util::checkAdminUser();
$params = array('cas_server_version', 'cas_server_hostname', 'cas_server_port', 'cas_server_path', 'cas_group_mapping', 'cas_group_root', 'cas_aliasName');
OCP\Util::addscript('user_cas', 'settings');
if ($_POST) {
    foreach ($params as $param) {
        if (isset($_POST[$param])) {
            OCP\Config::setAppValue('user_cas', $param, $_POST[$param]);
        } elseif ('cas_autocreate' == $param) {
            OCP\Config::setAppValue('user_cas', $param, 0);
        } elseif ('cas_update_user_data' == $param) {
            OCP\Config::setAppValue('user_cas', $param, 0);
        }
    }
}
// fill template
$tmpl = new OCP\Template('user_cas', 'settings');
foreach ($params as $param) {
    $value = htmlentities(OCP\Config::getAppValue('user_cas', $param, ''));
    $tmpl->assign($param, $value);
}
// settings with default values
$tmpl->assign('cas_server_version', OCP\Config::getAppValue('user_cas', 'cas_server_version', '2.0'));
$tmpl->assign('cas_server_hostname', OCP\Config::getAppValue('user_cas', 'cas_server_hostname', 'ident.domain.fr'));
$tmpl->assign('cas_server_port', OCP\Config::getAppValue('user_cas', 'cas_server_port', '443'));
$tmpl->assign('cas_server_path', OCP\Config::getAppValue('user_cas', 'cas_server_path', '/cas'));
$tmpl->assign('cas_group_mapping', OCP\Config::getAppValue('user_cas', 'cas_group_mapping', ''));
$tmpl->assign('cas_group_root', OCP\Config::getAppValue('user_cas', 'cas_group_root', ''));
$tmpl->assign('cas_aliasName', OCP\Config::getAppValue('user_cas', 'cas_aliasName', ''));
return $tmpl->fetchPage();
Esempio n. 26
0
<?php

OCP\User::checkAdminUser();
OCP\Util::addScript("ojsxc", "admin");
$tmpl = new OCP\Template('ojsxc', 'settings');
$tmpl->assign('boshUrl', OCP\Config::getAppValue('ojsxc', 'boshUrl'));
$tmpl->assign('xmppDomain', OCP\Config::getAppValue('ojsxc', 'xmppDomain'));
$tmpl->assign('xmppResource', OCP\Config::getAppValue('ojsxc', 'xmppResource'));
$tmpl->assign('xmppOverwrite', OCP\Config::getAppValue('ojsxc', 'xmppOverwrite'));
$tmpl->assign('xmppStartMinimized', OCP\Config::getAppValue('ojsxc', 'xmppStartMinimized'));
$tmpl->assign('iceUrl', OCP\Config::getAppValue('ojsxc', 'iceUrl'));
$tmpl->assign('iceUsername', OCP\Config::getAppValue('ojsxc', 'iceUsername'));
$tmpl->assign('iceCredential', OCP\Config::getAppValue('ojsxc', 'iceCredential'));
$tmpl->assign('iceSecret', OCP\Config::getAppValue('ojsxc', 'iceSecret'));
$tmpl->assign('iceTtl', OCP\Config::getAppValue('ojsxc', 'iceTtl'));
return $tmpl->fetchPage();
 * 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, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */
\OCP\JSON::checkAppEnabled('files_external_listing');
\OCP\JSON::checkLoggedIn();
\OCP\JSON::callCheck();
\OC_JSON::checkAdminUser();
$defaultDir = '/home';
if (\OC_Util::runningOnWindows()) {
    $defaultDir = 'C:\\';
}
$localroot = OCP\Config::getAppValue('files_external_listing', 'starting_dir', $defaultDir);
if (isset($_POST['path'])) {
    $path = realpath($_POST['path']);
    if (strpos($path, $localroot) === 0 or empty($_POST['path'])) {
        if (empty($_POST['path'])) {
            $path = $localroot;
        }
        if (!is_dir($path)) {
            //path is incorrect or is a file. Nothing to do, we work only with dirs
            OCP\JSON::error(array('data' => array('message' => 'Incorrect path: ' . $_POST['path'])));
        } elseif (isset($_POST['isnotempty']) && $_POST['isnotempty']) {
            //we only check if the dir has subdirs
            $dirs = glob($path . '/*', GLOB_ONLYDIR);
            OCP\JSON::success(array('data' => !empty($dirs)));
        } elseif (isset($_POST['ascendpath']) && $_POST['ascendpath']) {
            //we must return the full ascendance path, where
Esempio n. 28
0
/*
 * Copyright 2014 by Francesco PIRANEO G. (fpiraneo@gmail.com)
 * 
 * This file is part of oclife.
 * 
 * oclife is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * oclife is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with oclife.  If not, see <http://www.gnu.org/licenses/>.
 */
OCP\User::checkAdminUser();
// Handle translations
$l = new \OC_L10N('oclife');
OCP\Util::addscript('oclife', 'oclife/oclife_admin');
$useImageMagick = intval(OCP\Config::getAppValue('oclife', 'useImageMagick'));
$tmpl = new \OCP\Template('oclife', 'settings');
$tmpl->assign('useImageMagick', $useImageMagick === 1 ? 'CHECKED' : '');
$imagick = extension_loaded('imagick');
$imagickEnabled = $imagick ? $l->t('ImageMagick is loaded and ready to be used') : $l->t('ImageMagick is not loaded: Please refers to php manual.');
$tmpl->assign('imagickEnabled', $imagickEnabled);
$tmpl->assign('enImageMagick', $imagick ? '' : 'disabled="DISABLED"');
$tmpl->assign('imagickMessageColor', $imagick ? 'green' : 'red');
return $tmpl->fetchPage();
Esempio n. 29
0
* 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/>.
*/
OC_Util::checkAdminUser();
OCP\Util::addScript('files_external', 'settings');
OCP\Util::addscript('3rdparty', 'chosen/chosen.jquery.min');
OCP\Util::addStyle('files_external', 'settings');
OCP\Util::addStyle('3rdparty', 'chosen/chosen');
$backends = OC_Mount_Config::getBackends();
$personal_backends = array();
$enabled_backends = explode(',', OCP\Config::getAppValue('files_external', 'user_mounting_backends', ''));
foreach ($backends as $class => $backend) {
    if ($class != '\\OC\\Files\\Storage\\Local') {
        $personal_backends[$class] = array('backend' => $backend['backend'], 'enabled' => in_array($class, $enabled_backends));
    }
}
$tmpl = new OCP\Template('files_external', 'settings');
$tmpl->assign('isAdminPage', true);
$tmpl->assign('mounts', OC_Mount_Config::getSystemMountPoints());
$tmpl->assign('backends', $backends);
$tmpl->assign('personal_backends', $personal_backends);
$tmpl->assign('groups', OC_Group::getGroups());
$tmpl->assign('users', OCP\User::getUsers());
$tmpl->assign('userDisplayNames', OC_User::getDisplayNames());
$tmpl->assign('dependencies', OC_Mount_Config::checkDependencies());
$tmpl->assign('allowUserMounting', OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes'));
return $tmpl->fetchPage();
Esempio n. 30
0
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * 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 Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
// Check if we are a user
OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('roundcube');
OCP\Util::addStyle('roundcube', 'userSettings');
OCP\Util::addScript('roundcube', 'userSettings');
// fill template
$params = array();
$tmpl = new OCP\Template('roundcube', 'userSettings');
foreach ($params as $param) {
    $value = OCP\Config::getAppValue('roundcube', $param, '');
    $tmpl->assign($param, $value);
}
// workaround to detect OC version
$ocVersion = @reset(OCP\Util::getVersion());
$tmpl->assign('ocVersion', $ocVersion);
return $tmpl->fetchPage();