From ec31a29b3c0add4ab4adf1ba089282b7024b1eb1 Mon Sep 17 00:00:00 2001 From: Bartek Przybylski Date: Wed, 10 Aug 2011 20:12:42 +0200 Subject: [PATCH 01/23] Bug 279826 fix --- files/css/files.css | 4 +++- files/templates/index.php | 29 ++++++++++++++++------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/files/css/files.css b/files/css/files.css index 0ec1698bf3..004721cff9 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -1,9 +1,11 @@ /* FILE MENU */ .actions { padding:.6em; float:right; margin-right:13em; } .actions input { margin:0; padding:.3em; } +.actions div { position: relative; display:inline-block; } #file_menu { right:0; position:absolute; top:0; } #file_menu a { display:block; float:left; background-image:none; text-decoration:none; } -.file_upload_form, #file_newfolder_form { display:inline; } +.file_upload_form { display: inline; z-index: 5;} +#file_newfolder_form { display:inline; z-index: 6;} #fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; } .file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .3em; padding-left:2em; } .file_upload_wrapper { background:url("../img/file.png"); font-weight:bold; position:relative; top:-1.2em; left:-2em; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; width:8em; } diff --git a/files/templates/index.php b/files/templates/index.php index 3951787a25..d9a6c2b4b8 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -1,19 +1,22 @@
-
- - - -
- - -
- -
-
- -
+
+
+ + + +
+ + +
+ +
+
+
+ +
+
From 1dac5bb390852bf679ea02cfb28dc5c7292c537f Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 10 Aug 2011 20:48:56 +0200 Subject: [PATCH 02/23] fixed undo notification not showing --- core/css/styles.css | 3 +++ files/css/files.css | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 9da216a80d..273d7443a8 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -105,3 +105,6 @@ legend { padding:.2em; font-size:1.2em; } li.error { width:640px; margin:4em auto; padding:1em 1em 1em 4em; background:#fee url('../img/task-attention.png') .8em .8em no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } .hidden{ display:none; } +#notification{ z-index:400; background-color:#fc4; border:0; padding:0 .7em .3em; display:block; position:fixed; left:50%; top:0; +-moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; +-moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; } diff --git a/files/css/files.css b/files/css/files.css index 004721cff9..23fdf2ee50 100644 --- a/files/css/files.css +++ b/files/css/files.css @@ -1,3 +1,7 @@ +/* Copyright (c) 2011, Jan-Christoph Borchardt + This file is licensed under the Affero General Public License version 3 or later. + See the COPYING-README file. */ + /* FILE MENU */ .actions { padding:.6em; float:right; margin-right:13em; } .actions input { margin:0; padding:.3em; } @@ -54,6 +58,3 @@ table thead.fixed {height:2em} /* add breadcrumb divider to the File item in navigation panel */ #navigation>ul>li:first-child { background:url('../../core/img/breadcrumb-divider-start.png') no-repeat 12.5em 0px; width:12.5em; padding-right:1em; } -#notification{ z-index:150; background-color:#fc4; border:0; padding:0 .7em .3em; display:block; position:fixed; left:50%; top:0; --moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; --moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; } From 5324d6f7df91d4284b822debe49ef09bdc140d1a Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Wed, 10 Aug 2011 22:27:55 +0200 Subject: [PATCH 03/23] Small fixes --- apps/contacts/carddav.php | 4 ++-- apps/contacts/lib/addressbook.php | 4 ++-- apps/contacts/templates/index.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/contacts/carddav.php b/apps/contacts/carddav.php index 581bf4a717..77b3c105de 100644 --- a/apps/contacts/carddav.php +++ b/apps/contacts/carddav.php @@ -32,8 +32,8 @@ $carddavBackend = new OC_Connector_Sabre_CardDAV(); // Root nodes $nodes = array( - new Sabre_DAVACL_PrincipalCollection($principalBackend), - new Sabre_CardDAV_AddressBookRoot($principalBackend, $carddavBackend), + new Sabre_DAVACL_PrincipalCollection($principalBackend), + new Sabre_CardDAV_AddressBookRoot($principalBackend, $carddavBackend), ); // Fire up server diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php index 8b91cdbd6f..bab260840d 100644 --- a/apps/contacts/lib/addressbook.php +++ b/apps/contacts/lib/addressbook.php @@ -120,10 +120,10 @@ class OC_Contacts_Addressbook{ } public static function deleteAddressbook($id){ - $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE id = ?' ); + $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_addressbooks WHERE id = ?' ); $stmt->execute(array($id)); - $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_addressbooks WHERE addressbookid = ?' ); + $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE addressbookid = ?' ); $stmt->execute(array($id)); return true; diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index ea76621674..02b9d976cc 100644 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -13,5 +13,5 @@ OC_Util::addStyle('contacts','styles'); inc("part.details"); ?>
- t('The path to this addressbook is %s', array(OC::$WEBROOT.'/apps/contacts/carddav.php/addressbooks/'.$_['addressbooks'][0]['uri'])); ?> + t('The path to this addressbook is %s', array(OC::$WEBROOT.'/apps/contacts/carddav.php/addressbooks/'.OC_User::getUser().'/'.$_['addressbooks'][0]['uri'])); ?> From f03874ac4994ac54816828a7e5d58570080c5bcf Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 10 Aug 2011 20:51:35 +0200 Subject: [PATCH 04/23] work on user management --- admin/ajax/togglegroups.php | 4 + admin/apps.php | 13 ++- admin/css/users.css | 11 +-- admin/js/users.js | 110 ++++++++++--------------- admin/templates/users.php | 54 ++++++------ admin/users.php | 7 +- core/css/multiselect.css | 6 ++ core/css/styles.css | 6 +- core/js/js.js | 24 +++++- core/js/multiselect.js | 160 ++++++++++++++++++++++++++++++++++++ lib/base.php | 2 + lib/group.php | 13 ++- 12 files changed, 294 insertions(+), 116 deletions(-) create mode 100644 core/css/multiselect.css create mode 100644 core/js/multiselect.js diff --git a/admin/ajax/togglegroups.php b/admin/ajax/togglegroups.php index 808e57dc9d..1a0dc22be8 100644 --- a/admin/ajax/togglegroups.php +++ b/admin/ajax/togglegroups.php @@ -19,6 +19,10 @@ $action = "add"; $username = $_POST["username"]; $group = $_POST["group"]; +if(!OC_Group::groupExists($group)){ + OC_Group::createGroup($group); +} + // Toggle group if( OC_Group::inGroup( $username, $group )){ $action = "remove"; diff --git a/admin/apps.php b/admin/apps.php index 83a48b6524..07e93728a3 100644 --- a/admin/apps.php +++ b/admin/apps.php @@ -33,11 +33,16 @@ OC_Util::addScript( "admin", "apps" ); $registeredApps=OC_App::getAllApps(); $apps=array(); + +$blacklist=array('files_imageviewer','files_textviewer');//we dont want to show configuration for these + foreach($registeredApps as $app){ - $info=OC_App::getAppInfo($app); - $active=(OC_Appconfig::getValue($app,'enabled','no')=='yes')?true:false; - $info['active']=$active; - $apps[]=$info; + if(array_search($app,$blacklist)===false){ + $info=OC_App::getAppInfo($app); + $active=(OC_Appconfig::getValue($app,'enabled','no')=='yes')?true:false; + $info['active']=$active; + $apps[]=$info; + } } $categories=OC_OCSClient::getCategories(); diff --git a/admin/css/users.css b/admin/css/users.css index 521217df4f..27bd704c59 100644 --- a/admin/css/users.css +++ b/admin/css/users.css @@ -1,5 +1,6 @@ -form {display:inline} -td.remove>img,td.select>input{display:none;cursor:pointer} -td.select,td.remove{width:1em} -tr:hover>td.remove>img{display:inline} -li.selected{background-color:#ddd} +form { display:inline } +td.remove>img,td.select>input { display:none;cursor:pointer } +td.select,td.remove { width:1em } +tr:hover>td.remove>img { display:inline } +li.selected { background-color:#ddd } +#content>table { margin-top:6.5em } diff --git a/admin/js/users.js b/admin/js/users.js index 7e643fb60a..7402255750 100644 --- a/admin/js/users.js +++ b/admin/js/users.js @@ -1,5 +1,37 @@ $(document).ready(function(){ - $('select[multiple]').chosen(); + function applyMultiplySelect(element){ + var checked=[]; + var user=element.data('username') + if(element.data('userGroups')){ + checked=element.data('userGroups').split(', '); + } + if(user){ + var checkHandeler=function(group){ + if(user==OC.currentUser && group=='admin'){ + return false; + } + $.post( + OC.filePath('admin','ajax','togglegroups.php'), + { + username:user, + group:group + }, + function(){} + ); + } + }else{ + checkHandeler=false; + } + element.multiSelect({ + createText:'add group', + checked:checked, + oncheck:checkHandeler, + onuncheck:checkHandeler + }); + } + $('select[multiple]').each(function(index,element){ + applyMultiplySelect($(element)); + }); $('td.remove>img').live('click',function(event){ var uid=$(this).parent().parent().data('uid'); @@ -17,7 +49,7 @@ $(document).ready(function(){ event.preventDefault(); var username=$('#newusername').val(); var password=$('#newuserpassword').val(); - var groups=$('#newusergroups').val(); + var groups=$('#newusergroups').prev().children('div').data('settings').checked; $.post( OC.filePath('admin','ajax','createuser.php'), { @@ -29,72 +61,18 @@ $(document).ready(function(){ } ); - var tr=$('#rightcontent tr').first().clone(); + var tr=$('#content table tr').first().clone(); tr.attr('data-uid',username); tr.find('td.name').text(username); - tr.find('td.groups').text(groups.join(', ')); - $('#rightcontent tr').first().after(tr); - if(groups.indexOf($('#leftcontent li.selected').text().trim())!=-1){ - tr.find('td.select input').attr('checked','checked'); - } - }); - - $('#newgroup').submit(function(event){ - event.preventDefault(); - var name=$('#newgroupname').val(); - $.post( - OC.filePath('admin','ajax','creategroup.php'), - {groupname:name}, - function(result){ - - } - ); - $('#newusergroups').append(''); - $('select[multiple]').trigger("liszt:updated"); - var li=$('#leftcontent li').first().next().clone(); - li.text(name); - $('#leftcontent li').first().after(li); - }); - - $('#leftcontent li').live('click',function(event){ - $('#leftcontent li').removeClass('selected'); - $(this).addClass('selected'); - $('#rightcontent tr td.select input').show(); - $('#rightcontent tr td.select input').removeAttr('checked'); - var group=$(this).text().trim(); - var rows=$('#rightcontent tr').filter(function(i,tr){ - return ($(tr).children('td.groups').text().split(', ').indexOf(group)>-1); + var select=$(' - -
@@ -14,29 +10,29 @@
-