diff options
-rw-r--r-- | apps/files/css/files.css | 2 | ||||
-rw-r--r-- | apps/files_sharing/css/sharing.css | 6 | ||||
-rw-r--r-- | apps/media/css/music.css | 4 | ||||
-rw-r--r-- | apps/user_ldap/group_ldap.php | 28 | ||||
-rw-r--r-- | apps/user_ldap/lib_ldap.php | 37 | ||||
-rw-r--r-- | core/css/multiselect.css | 10 | ||||
-rw-r--r-- | core/css/styles.css | 2 | ||||
-rw-r--r-- | lib/base.php | 5 | ||||
-rw-r--r-- | lib/public/util.php | 60 | ||||
-rw-r--r-- | search/css/results.css | 4 | ||||
-rw-r--r-- | settings/css/settings.css | 4 |
11 files changed, 137 insertions, 25 deletions
diff --git a/apps/files/css/files.css b/apps/files/css/files.css index d50d9aa9c5a..445b50db09d 100644 --- a/apps/files/css/files.css +++ b/apps/files/css/files.css @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Jan-Christoph Borchardt +/* Copyright (c) 2011, Jan-Christoph Borchardt, http://jancborchardt.net This file is licensed under the Affero General Public License version 3 or later. See the COPYING-README file. */ diff --git a/apps/files_sharing/css/sharing.css b/apps/files_sharing/css/sharing.css index db59a3d340b..5acd9af589a 100644 --- a/apps/files_sharing/css/sharing.css +++ b/apps/files_sharing/css/sharing.css @@ -1,3 +1,7 @@ +/* Copyright (c) 2011, Jan-Christoph Borchardt, http://jancborchardt.net + This file is licensed under the Affero General Public License version 3 or later. + See the COPYING-README file. */ + #dropdown { display:block; position:absolute; z-index:100; width:16em; right:0; margin-right:7em; background:#eee; padding:1em; -moz-box-shadow:0 1px 1px #777; -webkit-box-shadow:0 1px 1px #777; box-shadow:0 1px 1px #777; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; @@ -6,4 +10,4 @@ #public { border-top:1px solid #ddd; padding-top:0.5em; } a.unshare { float:right; display:inline; margin:0 .5em; padding:.3em .3em 0 .3em !important; opacity:.5; } a.unshare:hover { opacity:1; } -#share_with { width: 16em; }
\ No newline at end of file +#share_with { width: 16em; } diff --git a/apps/media/css/music.css b/apps/media/css/music.css index 164a6c62ae6..c782e8afeeb 100644 --- a/apps/media/css/music.css +++ b/apps/media/css/music.css @@ -1,3 +1,7 @@ +/* Copyright (c) 2011, Jan-Christoph Borchardt, http://jancborchardt.net + This file is licensed under the Affero General Public License version 3 or later. + See the COPYING-README file. */ + #controls ul.jp-controls { padding:0; } #controls ul.jp-controls li { display:inline; } #controls ul.jp-controls li a { position:absolute; padding:.8em 1em .8em 0; } diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index e5948459dd0..fe0789cdeb7 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -25,6 +25,7 @@ class OC_GROUP_LDAP extends OC_Group_Backend { // //group specific settings protected $ldapGroupFilter; protected $ldapGroupDisplayName; + protected $ldapGroupMemberAttr; public function __construct() { $this->ldapGroupFilter = OC_Appconfig::getValue('user_ldap', 'ldap_group_filter', '(objectClass=posixGroup)'); @@ -46,14 +47,12 @@ class OC_GROUP_LDAP extends OC_Group_Backend { LDAP_GROUP_MEMBER_ASSOC_ATTR.'='.$uid, $this->ldapGroupDisplayName.'='.$gid )); - $groups = OC_LDAP::search($filter, $this->ldapGroupDisplayName); + $groups = $this->retrieveList($filter, $this->ldapGroupDisplayName); - if(count($groups) == 1) { + if(count($groups) > 0) { return true; - } else if(count($groups) < 1) { - return false; } else { - throw new Exception('Too many groups of the same name!? – this exception should never been thrown :)'); + return false; } } @@ -84,7 +83,7 @@ class OC_GROUP_LDAP extends OC_Group_Backend { $this->ldapGroupDisplayName.'='.$gid )); - return $this->retrieveList($filter, $this->ldapGroupMemberAttr); + return $this->retrieveList($filter, $this->ldapGroupMemberAttr, false); } /** @@ -94,13 +93,7 @@ class OC_GROUP_LDAP extends OC_Group_Backend { * Returns a list with all groups */ public function getGroups() { - $groups = OC_LDAP::search($this->ldapGroupFilter, $this->ldapGroupDisplayName); - - if(count($groups) == 0 ) - return array(); - else { - return array_unique($groups, SORT_LOCALE_STRING); - } + return $this->retrieveList($this->ldapGroupFilter, $this->ldapGroupDisplayName); } /** @@ -112,8 +105,13 @@ class OC_GROUP_LDAP extends OC_Group_Backend { return in_array($gid, $this->getGroups()); } - private function retrieveList($filter, $attr) { - $list = OC_LDAP::search($filter, $attr); + private function retrieveList($filter, $attr, $searchForGroups = true) { + if($searchForGroups) { + $list = OC_LDAP::searchGroups($filter, $attr); + } else { + $list = OC_LDAP::searchUsers($filter, $attr); + } + if(is_array($list)) { return array_unique($list, SORT_LOCALE_STRING); diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php index eea4a82011c..752ac4f2289 100644 --- a/apps/user_ldap/lib_ldap.php +++ b/apps/user_ldap/lib_ldap.php @@ -38,6 +38,8 @@ class OC_LDAP { static protected $ldapHost; static protected $ldapPort; static protected $ldapBase; + static protected $ldapBaseUsers; + static protected $ldapBaseGroups; static protected $ldapAgentName; static protected $ldapAgentPassword; static protected $ldapTLS; @@ -65,15 +67,40 @@ class OC_LDAP { } /** + * @brief executes an LDAP search, optimized for Users + * @param $filter the LDAP filter for the search + * @param $attr optional, when a certain attribute shall be filtered out + * @returns array with the search result + * + * Executes an LDAP search + */ + static public function searchUsers($filter, $attr = null) { + return self::search($filter, self::$ldapBaseUsers, $attr); + } + + /** + * @brief executes an LDAP search, optimized for Groups + * @param $filter the LDAP filter for the search + * @param $attr optional, when a certain attribute shall be filtered out + * @returns array with the search result + * + * Executes an LDAP search + */ + static public function searchGroups($filter, $attr = null) { + return self::search($filter, self::$ldapBaseGroups, $attr); + } + + /** * @brief executes an LDAP search * @param $filter the LDAP filter for the search + * @param $base the LDAP subtree that shall be searched * @param $attr optional, when a certain attribute shall be filtered out * @returns array with the search result * * Executes an LDAP search */ - static public function search($filter, $attr = null) { - $sr = ldap_search(self::getConnectionResource(), self::$ldapBase, $filter); + static private function search($filter, $base, $attr = null) { + $sr = ldap_search(self::getConnectionResource(), $base, $filter, array($attr)); $findings = ldap_get_entries(self::getConnectionResource(), $sr ); if(!is_null($attr)) { @@ -150,7 +177,9 @@ class OC_LDAP { self::$ldapPort = OC_Appconfig::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT); self::$ldapAgentName = OC_Appconfig::getValue('user_ldap', 'ldap_dn',''); self::$ldapAgentPassword = OC_Appconfig::getValue('user_ldap', 'ldap_password',''); - self::$ldapBase = OC_Appconfig::getValue('user_ldap', 'ldap_base',''); + self::$ldapBase = OC_Appconfig::getValue('user_ldap', 'ldap_base', ''); + self::$ldapBaseUsers = OC_Appconfig::getValue('user_ldap', 'ldap_base_users',self::$ldapBase); + self::$ldapBaseGroups = OC_Appconfig::getValue('user_ldap', 'ldap_base_groups', self::$ldapBase); self::$ldapTLS = OC_Appconfig::getValue('user_ldap', 'ldap_tls',0); 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); @@ -163,6 +192,8 @@ class OC_LDAP { || ( empty(self::$ldapAgentName) && empty(self::$ldapAgentPassword)) ) && !empty(self::$ldapBase) + && !empty(self::$ldapBaseUsers) + && !empty(self::$ldapBaseGroups) && !empty(self::$ldapUserDisplayName) ) { diff --git a/core/css/multiselect.css b/core/css/multiselect.css index 1202ea18427..040b0f46ed3 100644 --- a/core/css/multiselect.css +++ b/core/css/multiselect.css @@ -1,7 +1,11 @@ +/* Copyright (c) 2011, Jan-Christoph Borchardt, http://jancborchardt.net + This file is licensed under the Affero General Public License version 3 or later. + See the COPYING-README file. */ + ul.multiselectoptions { z-index:49; position:absolute; background-color:#fff; padding-top:.5em; border:1px solid #ddd; border-top:none; -moz-border-radius-bottomleft:.5em; -webkit-border-bottom-left-radius:.5em; border-bottom-left-radius:.5em; -moz-border-radius-bottomright:.5em; -webkit-border-bottom-right-radius:.5em; border-bottom-right-radius:.5em; -moz-box-shadow:0 1px 1px #ddd; -webkit-box-shadow:0 1px 1px #ddd; box-shadow:0 1px 1px #ddd; } ul.multiselectoptions>li{ white-space:nowrap; overflow: hidden; } -div.multiselect { padding-right:.6em; display:inline; position:relative; display:inline-block; vertical-align: bottom; } +div.multiselect { padding-right:.6em; display:inline; position:relative; display:inline-block; vertical-align: bottom; min-width:100px; max-width:400px; } div.multiselect.active { background-color:#fff; border-bottom:none; border-bottom-left-radius:0; border-bottom-right-radius:0; z-index:50; position:relative } -div.multiselect>span:first-child { margin-right:2em; float:left; } -div.multiselect>span:last-child { float:right; position:relative } +div.multiselect>span:first-child { margin-right:2em; float:left; width:90%; overflow:hidden; text-overflow:ellipsis; } +div.multiselect>span:last-child { position:absolute; right:.8em; } ul.multiselectoptions input.new{ margin:0; padding-bottom:0.2em; padding-top:0.2em; border-top-left-radius:0; border-top-right-radius:0; } diff --git a/core/css/styles.css b/core/css/styles.css index ccebc984fbb..945e5846683 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, Jan-Christoph Borchardt +/* Copyright (c) 2011, Jan-Christoph Borchardt, http://jancborchardt.net This file is licensed under the Affero General Public License version 3 or later. See the COPYING-README file. */ diff --git a/lib/base.php b/lib/base.php index 559d49ca997..97b363b1fa9 100644 --- a/lib/base.php +++ b/lib/base.php @@ -88,6 +88,9 @@ class OC{ elseif(strpos($className,'OC_')===0){ require_once strtolower(str_replace('_','/',substr($className,3)) . '.php'); } + elseif(strpos($className,'OCP\\')===0){ + require_once 'public/'.strtolower(str_replace('\\','/',substr($className,3)) . '.php'); + } elseif(strpos($className,'Sabre_')===0) { require_once str_replace('_','/',$className) . '.php'; } @@ -436,4 +439,4 @@ if(!function_exists('get_temp_dir')) { } } -OC::init();
\ No newline at end of file +OC::init(); diff --git a/lib/public/util.php b/lib/public/util.php new file mode 100644 index 00000000000..3425ed9df3b --- /dev/null +++ b/lib/public/util.php @@ -0,0 +1,60 @@ +<?php +/** +* ownCloud +* +* @author Frank Karlitschek +* @copyright 2010 Frank Karlitschek karlitschek@kde.org +* +* 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/>. +* +*/ + +/** + * Public interface of ownCloud for apps to use. + * Utility Class. + * + */ + +// use OCP namespace for all classes that are considered public. +// This means that they should be used by apps instead of the internal ownCloud classes +namespace OCP; + +class Util { + + /** + * send an email + * + * @param string $toaddress + * @param string $toname + * @param string $subject + * @param string $mailtext + * @param string $fromaddress + * @param string $fromname + * @param bool $html + */ + public static function sendmail($toaddress,$toname,$subject,$mailtext,$fromaddress,$fromname,$html=0,$altbody='',$ccaddress='',$ccname='',$bcc='') { + + // call the internal mail class + OC_MAIL::send($toaddress,$toname,$subject,$mailtext,$fromaddress,$fromname,$html=0,$altbody='',$ccaddress='',$ccname='',$bcc=''); + + } + + + +} + + + + +?> diff --git a/search/css/results.css b/search/css/results.css index 440e68ee48f..40d5563e89e 100644 --- a/search/css/results.css +++ b/search/css/results.css @@ -1,3 +1,7 @@ +/* Copyright (c) 2011, Jan-Christoph Borchardt, http://jancborchardt.net + This file is licensed under the Affero General Public License version 3 or later. + See the COPYING-README file. */ + #searchresults { list-style:none; position:fixed; top:3.5em; right:0; z-index:75; background-color:#fff; overflow:hidden; text-overflow:ellipsis; max-height:80%; width:26.5em; padding-bottom:1em; -moz-box-shadow:0 0 10px #000; -webkit-box-shadow:0 0 10px #000; box-shadow:0 0 10px #000; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; } #searchresults li.resultHeader { font-size:1.2em; font-weight:bold; border-bottom:solid 1px #CCC; padding:.2em; background-color:#eee; } #searchresults li.result { margin-left:2em; } diff --git a/settings/css/settings.css b/settings/css/settings.css index 62e84654d55..36d9b8d26f9 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -1,3 +1,7 @@ +/* Copyright (c) 2011, Jan-Christoph Borchardt, http://jancborchardt.net + This file is licensed under the Affero General Public License version 3 or later. + See the COPYING-README file. */ + select#languageinput, select#timezone { width:15em; } input#openid, input#webdav { width:20em; } |