diff --git a/core/js/share.js b/core/js/share.js index 8ef76e2d08..7f6ee0ec41 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -235,7 +235,18 @@ OC.Share={ }); return false; } - }); + }) + // customize internal _renderItem function to display groups and users differently + .data("ui-autocomplete")._renderItem = function( ul, item ) { + var insert = $( "" ).text( item.label ); + if(item.label.length > 8 && item.label.substr(item.label.length-8) === ' (group)') { + // current label is group - wrap "strong" element + insert = insert.wrapInner(''); + } + return $( "
  • " ) + .append( insert ) + .appendTo( ul ); + }; } else { html += ''; html += ''; diff --git a/lib/installer.php b/lib/installer.php index 251d115b76..49ba449263 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -134,8 +134,10 @@ class OC_Installer{ } // check if the app is compatible with this version of ownCloud - $version=OC_Util::getVersion(); - if(!isset($info['require']) or ($version[0]>$info['require'])) { + if( + !isset($info['require']) + or !OC_App::isAppVersionCompatible(OC_Util::getVersion(), $info['require']) + ) { OC_Log::write('core', 'App can\'t be installed because it is not compatible with this version of ownCloud', OC_Log::ERROR); diff --git a/lib/util.php b/lib/util.php index 7e8fc9b6bb..1fa3ad765d 100755 --- a/lib/util.php +++ b/lib/util.php @@ -411,18 +411,19 @@ class OC_Util { exit(); } - /** - * get an id unqiue for this instance - * @return string - */ - public static function getInstanceId() { - $id=OC_Config::getValue('instanceid', null); - if(is_null($id)) { - $id=uniqid(); - OC_Config::setValue('instanceid', $id); - } - return $id; - } + /** + * get an id unique for this instance + * @return string + */ + public static function getInstanceId() { + $id = OC_Config::getValue('instanceid', null); + if(is_null($id)) { + // We need to guarantee at least one letter in instanceid so it can be used as the session_name + $id = 'oc' . uniqid(); + OC_Config::setValue('instanceid', $id); + } + return $id; + } /** * @brief Static lifespan (in seconds) when a request token expires. diff --git a/settings/css/settings.css b/settings/css/settings.css index 265a29b8f7..46a0bbe7c3 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -79,6 +79,7 @@ span.version { margin-left:1em; margin-right:1em; color:#555; } /* LOG */ #log { white-space:normal; } +#lessLog { display:none; } /* ADMIN */ span.securitywarning {color:#C33; font-weight:bold; } diff --git a/settings/js/log.js b/settings/js/log.js index 09b8ec1ab4..81117f9e82 100644 --- a/settings/js/log.js +++ b/settings/js/log.js @@ -1,5 +1,6 @@ /** * Copyright (c) 2012, Robin Appelman + * Copyright (c) 2013, Morris Jobke * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */ @@ -16,19 +17,27 @@ OC.Log={ levels:['Debug','Info','Warning','Error','Fatal'], loaded:3,//are initially loaded getMore:function(count){ - if(!count){ - count=10; - } + count = count || 10; $.get(OC.filePath('settings','ajax','getlog.php'),{offset:OC.Log.loaded,count:count},function(result){ if(result.status=='success'){ OC.Log.addEntries(result.data); - $('html, body').animate({scrollTop: $(document).height()}, 800); if(!result.remain){ - $('#moreLog').css('display', 'none'); + $('#moreLog').hide(); } + $('#lessLog').show(); } }); }, + showLess:function(count){ + count = count || 10; + //calculate remaining items - at least 3 + OC.Log.loaded = Math.max(3,OC.Log.loaded-count); + $('#moreLog').show(); + // remove all non-remaining items + $('#log tr').slice(OC.Log.loaded).remove(); + if(OC.Log.loaded <= 3) + $('#lessLog').hide(); + }, addEntries:function(entries){ for(var i=0;i'); levelTd.text(OC.Log.levels[entry.level]); row.append(levelTd); - + var appTd=$(''); appTd.text(entry.app); row.append(appTd); - + var messageTd=$(''); messageTd.text(entry.message); row.append(messageTd); - + var timeTd=$(''); timeTd.text(formatDate(entry.time*1000)); row.append(timeTd); @@ -58,4 +67,7 @@ $(document).ready(function(){ $('#moreLog').click(function(){ OC.Log.getMore(); }) + $('#lessLog').click(function(){ + OC.Log.showLess(); + }) }); diff --git a/settings/js/users.js b/settings/js/users.js index b0a70215f1..d79b21765f 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -6,6 +6,7 @@ var UserList = { useUndo: true, + availableGroups: [], /** * @brief Initiate user deletion process in UI @@ -78,8 +79,7 @@ var UserList = { var subadminSelect = $(' - +
    @@ -220,7 +220,8 @@ endfor;?>
    - ...'> + + diff --git a/tests/lib/util.php b/tests/lib/util.php index 1c9054264c..1f25382592 100644 --- a/tests/lib/util.php +++ b/tests/lib/util.php @@ -54,4 +54,9 @@ class Test_Util extends PHPUnit_Framework_TestCase { $this->assertEquals('no-reply@example.com', $email); OC_Config::deleteKey('mail_domain'); } + + function testGetInstanceIdGeneratesValidId() { + OC_Config::deleteKey('instanceid'); + $this->assertStringStartsWith('oc', OC_Util::getInstanceId()); + } }