diff options
author | Georg Ehrke <dev@georgswebsite.de> | 2012-04-18 12:20:09 +0200 |
---|---|---|
committer | Georg Ehrke <dev@georgswebsite.de> | 2012-04-18 12:20:09 +0200 |
commit | eb29c577c2b2378c1983e55ddaf4955ad9ae7fe2 (patch) | |
tree | 4a53459150c6485666e350982ef3ad61ab3936c8 /apps | |
parent | 3e0e6e35f4fa638dd42bd5adc3b26e078bf3d081 (diff) | |
parent | 57b8ff890c75169521041b4eb9cdf4582b68e551 (diff) | |
download | nextcloud-server-eb29c577c2b2378c1983e55ddaf4955ad9ae7fe2.tar.gz nextcloud-server-eb29c577c2b2378c1983e55ddaf4955ad9ae7fe2.zip |
Merge branch 'master' into movable_apps
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_archive/tests/data/data.tar.gz | bin | 0 -> 4195 bytes | |||
-rw-r--r-- | apps/files_archive/tests/data/data.zip | bin | 0 -> 4705 bytes | |||
-rw-r--r-- | apps/files_archive/tests/data/lorem.txt | 4 | ||||
-rw-r--r-- | apps/remoteStorage/auth.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/appinfo/app.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/group_ldap.php | 12 | ||||
-rw-r--r-- | apps/user_ldap/lib_ldap.php | 37 | ||||
-rw-r--r-- | apps/user_openid/templates/nomode.php | 2 |
8 files changed, 49 insertions, 10 deletions
diff --git a/apps/files_archive/tests/data/data.tar.gz b/apps/files_archive/tests/data/data.tar.gz Binary files differnew file mode 100644 index 00000000000..39f2cdada02 --- /dev/null +++ b/apps/files_archive/tests/data/data.tar.gz diff --git a/apps/files_archive/tests/data/data.zip b/apps/files_archive/tests/data/data.zip Binary files differnew file mode 100644 index 00000000000..eccef53eb4e --- /dev/null +++ b/apps/files_archive/tests/data/data.zip diff --git a/apps/files_archive/tests/data/lorem.txt b/apps/files_archive/tests/data/lorem.txt new file mode 100644 index 00000000000..b62c3fb2ffd --- /dev/null +++ b/apps/files_archive/tests/data/lorem.txt @@ -0,0 +1,4 @@ +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. +Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\ No newline at end of file diff --git a/apps/remoteStorage/auth.php b/apps/remoteStorage/auth.php index d2b9eece35b..69d7cfc3b93 100644 --- a/apps/remoteStorage/auth.php +++ b/apps/remoteStorage/auth.php @@ -77,7 +77,7 @@ if(count($pathParts) == 2 && $pathParts[0] == '') { <div id="login"> <header> <div id="header"> - <img src="../../../core/img/owncloud-logo-medium-white.png" alt="ownCloud" /> + <img src="../../../core/img/logo.png" alt="ownCloud" /> </div> </header> <section id="main"> diff --git a/apps/user_ldap/appinfo/app.php b/apps/user_ldap/appinfo/app.php index 4e4da56f054..113c8d6b7bb 100644 --- a/apps/user_ldap/appinfo/app.php +++ b/apps/user_ldap/appinfo/app.php @@ -35,7 +35,7 @@ define('OC_USER_BACKEND_LDAP_DEFAULT_DISPLAY_NAME', 'uid'); // register user backend OC_User::useBackend( 'LDAP' ); -OC_Group::useBackend( 'LDAP' ); +OC_Group::useBackend( new OC_GROUP_LDAP() ); // add settings page to navigation $entry = array( diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 92e3b53d249..e5948459dd0 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -29,6 +29,7 @@ class OC_GROUP_LDAP extends OC_Group_Backend { public function __construct() { $this->ldapGroupFilter = OC_Appconfig::getValue('user_ldap', 'ldap_group_filter', '(objectClass=posixGroup)'); $this->ldapGroupDisplayName = OC_Appconfig::getValue('user_ldap', 'ldap_group_display_name', 'cn'); + $this->ldapGroupMemberAttr = OC_Appconfig::getValue('user_ldap', 'ldap_group_member_attr', 'memberUid'); } /** @@ -83,7 +84,7 @@ class OC_GROUP_LDAP extends OC_Group_Backend { $this->ldapGroupDisplayName.'='.$gid )); - return $this->retrieveList($filter, OC_LDAP::conf('ldapUserDisplayName')); + return $this->retrieveList($filter, $this->ldapGroupMemberAttr); } /** @@ -102,6 +103,15 @@ class OC_GROUP_LDAP extends OC_Group_Backend { } } + /** + * check if a group exists + * @param string $gid + * @return bool + */ + public function groupExists($gid){ + return in_array($gid, $this->getGroups()); + } + private function retrieveList($filter, $attr) { $list = OC_LDAP::search($filter, $attr); diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php index 5188ef94026..eea4a82011c 100644 --- a/apps/user_ldap/lib_ldap.php +++ b/apps/user_ldap/lib_ldap.php @@ -21,7 +21,14 @@ * */ -define(LDAP_GROUP_MEMBER_ASSOC_ATTR,'memberUid'); +define('LDAP_GROUP_MEMBER_ASSOC_ATTR','memberUid'); + +//needed to unbind, because we use OC_LDAP only statically +class OC_LDAP_DESTRUCTOR { + public function __destruct() { + OC_LDAP::destruct(); + } +} class OC_LDAP { static protected $ldapConnectionRes = false; @@ -38,14 +45,19 @@ class OC_LDAP { // user and group settings, that are needed in both backends static public $ldapUserDisplayName; - static public function init() { self::readConfiguration(); self::establishConnection(); } + static public function destruct() { + @ldap_unbind(self::$ldapConnectionRes); + } + static public function conf($key) { - $availableProperties = array('ldapUserDisplayName'); + $availableProperties = array( + 'ldapUserDisplayName', + ); if(in_array($key, $availableProperties)) { return self::$$key; @@ -143,8 +155,19 @@ class OC_LDAP { self::$ldapNoCase = OC_Appconfig::getValue('user_ldap', 'ldap_nocase', 0); self::$ldapUserDisplayName = OC_Appconfig::getValue('user_ldap', 'ldap_display_name', OC_USER_BACKEND_LDAP_DEFAULT_DISPLAY_NAME); - //TODO: sanity checking - self::$configured = true; + if( + !empty(self::$ldapHost) + && !empty(self::$ldapPort) + && ( + (!empty(self::$ldapAgentName) && !empty(self::$ldapAgentPassword)) + || ( empty(self::$ldapAgentName) && empty(self::$ldapAgentPassword)) + ) + && !empty(self::$ldapBase) + && !empty(self::$ldapUserDisplayName) + ) + { + self::$configured = true; + } } } @@ -152,6 +175,9 @@ class OC_LDAP { * Connects and Binds to LDAP */ static private function establishConnection() { + if(!self::$configured) { + return false; + } if(!self::$ldapConnectionRes) { self::$ldapConnectionRes = ldap_connect(self::$ldapHost, self::$ldapPort); if(ldap_set_option(self::$ldapConnectionRes, LDAP_OPT_PROTOCOL_VERSION, 3)) { @@ -162,7 +188,6 @@ class OC_LDAP { } } - //TODO: Check if it works. Before, it was outside the resource-condition $ldapLogin = @ldap_bind(self::$ldapConnectionRes, self::$ldapAgentName, self::$ldapAgentPassword ); if(!$ldapLogin) { return false; diff --git a/apps/user_openid/templates/nomode.php b/apps/user_openid/templates/nomode.php index f85d28cdc9b..3bab4c2edd1 100644 --- a/apps/user_openid/templates/nomode.php +++ b/apps/user_openid/templates/nomode.php @@ -5,7 +5,7 @@ global $profile; ?> <div id="login"> - <img src="<?php echo image_path("", "owncloud-logo-medium-white.png"); ?>" alt="ownCloud" /> + <img src="<?php echo image_path("", "logo.png"); ?>" alt="ownCloud" /> <ul> <li class='error'> <div id="setup_form"> |