Skip to content
Snippets Groups Projects
Commit 475dd72e authored by Frank Karlitschek's avatar Frank Karlitschek
Browse files

Merge branch 'master' of gitorious.org:owncloud/owncloud

parents 0fcd765b e30220e2
No related branches found
No related tags found
No related merge requests found
......@@ -28,3 +28,6 @@ RCS/*
# eclipse
.project
.settings
# netbeans
nbproject
......@@ -4,7 +4,7 @@ It is alpha software in development and should be treated accordingly.
http://ownCloud.org
Installation instructions: http://owncloud.org/index.php/Installation
Installation instructions: http://owncloud.org/install
Source code: http://gitorious.org/owncloud
Mailing list: http://mail.kde.org/mailman/listinfo/owncloud
......
......@@ -9,8 +9,9 @@ div.jp-progress { position:absolute; overflow:hidden; top:.5em; left:8em; width:
div.jp-seek-bar { background:#eee; width:0; height:100%; cursor:pointer; }
div.jp-play-bar { background:#ccc; width:0; height:100%; }
div.jp-seeking-bg { background:url("../img/pbar-ani.gif"); }
div.jp-current-time,div.jp-duration { position:absolute; font-size:.64em; font-style:oblique; top:1em; left:13.5em; }
div.jp-duration { left:33em; }
div.jp-current-time,div.jp-duration { position:absolute; font-size:.64em; font-style:oblique; top:0.9em; left:13.5em; }
div.jp-duration { display: none }
div.jp-current-song { left: 33em; position: absolute; top: 0.9em; }
div.jp-duration { text-align:right; }
a.jp-mute,a.jp-unmute { left:24em; }
......@@ -21,9 +22,11 @@ div.jp-volume-bar-value { background:#ccc; width:0; height:0.4em; }
#collection li.album,#collection li.song { margin-left:3em; }
#leftcontent img.remove { display:none; float:right; cursor:pointer; }
#leftcontent li:hover img.remove { display:inline; }
#leftcontent li {white-space: normal; }
#collection li button { float:right; }
#collection li,#playlist li { list-style-type:none; }
.template { display:none; }
.collection_playing { background:#eee; }
#collection li { padding-right:10px; }
#searchresults input.play, #searchresults input.add { float:left; height:1em; width:1em; }
......@@ -34,6 +37,7 @@ tr td { border-top:1px solid #eee; height:2.2em; }
tr .artist img { vertical-align:middle; }
tr.album td.artist { padding-left:1em; }
tr.song td.artist { padding-left:2em; }
.add {margin: 0 0.5em 0 0; }
#scan { position:absolute; right:13em; top:0em; }
#scan .start { position:relative; display:inline; float:right; }
......
......@@ -15,7 +15,7 @@ $(document).ready(function(){
PlayList.play(oldSize);
PlayList.render();
});
var button=$('<input type="button" title="'+t('media','Add to playlist')+'" class="add"></input>');
var button=$('<input type="button" title="'+t('media','Add album to playlist')+'" class="add"></input>');
button.css('background-image','url('+OC.imagePath('core','actions/play-add')+')')
button.click(function(event){
event.stopPropagation();
......@@ -24,6 +24,7 @@ $(document).ready(function(){
});
row.find('div.name').append(button);
}
$('.add').tipsy({gravity:'n', fade:true, delayIn: 400, live:true});
Collection.display();
});
......
......@@ -39,6 +39,7 @@ var PlayList={
PlayList.init(items[index].type,null); // init calls load that calls play
}else{
PlayList.player.jPlayer("setMedia", items[PlayList.current]);
$(".jp-current-song").text(items[PlayList.current].name);
items[index].playcount++;
PlayList.player.jPlayer("play",time);
if(index>0){
......@@ -67,6 +68,8 @@ var PlayList={
PlayList.init(items[index].type,null); // init calls load that calls play
}
}
$(".song").removeClass("collection_playing");
$(".jp-playlist-" + index).addClass("collection_playing");
},
init:function(type,ready){
if(!PlayList.player){
......
......@@ -5,6 +5,7 @@ PlayList.render=function(){
var item=PlayList.items[i];
var li=$('<li/>');
li.append(item.name);
li.attr('class', 'jp-playlist-' + i);
var img=$('<img class="remove svg action" src="'+OC.imagePath('core','actions/delete')+'"/>');
img.click(function(event){
event.stopPropagation();
......@@ -18,6 +19,7 @@ PlayList.render=function(){
li.addClass('song');
PlayList.parent.append(li);
}
$(".jp-playlist-" + PlayList.current).addClass("collection_playing");
}
PlayList.getSelected=function(){
return $('tbody td.name input:checkbox:checked').parent().parent();
......
......@@ -17,6 +17,7 @@
<div class="jp-volume-bar">
<div class="jp-volume-bar-value"></div>
</div>
<div class="jp-current-song"></div>
<div class="player" id="jp-player"></div>
......
......@@ -24,7 +24,7 @@ class OC_Util {
$success=@mkdir($CONFIG_DATADIRECTORY_ROOT);
if(!$success) {
$tmpl = new OC_Template( '', 'error', 'guest' );
$tmpl->assign('errors',array(1=>array('error'=>"Can't create data directory (".$CONFIG_DATADIRECTORY_ROOT.")",'hint'=>"You can usually fix this by setting the owner of '".OC::$SERVERROOT."' to the user that the web server uses (".exec('whoami').")")));
$tmpl->assign('errors',array(1=>array('error'=>"Can't create data directory (".$CONFIG_DATADIRECTORY_ROOT.")",'hint'=>"You can usually fix this by setting the owner of '".OC::$SERVERROOT."' to the user that the web server uses (".OC_Util::checkWebserverUser().")")));
$tmpl->printPage();
exit;
}
......@@ -200,28 +200,21 @@ class OC_Util {
}
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
$CONFIG_DBNAME = OC_Config::getValue( "dbname", "owncloud" );
//try to get the username the httpd server runs on, used in hints
$stat=stat($_SERVER['DOCUMENT_ROOT']);
if(is_callable('posix_getpwuid')){
$serverUser=posix_getpwuid($stat['uid']);
$serverUser='\''.$serverUser['name'].'\'';
}else{
$serverUser='\'www-data\' for ubuntu/debian';//TODO: try to detect the distro and give a guess based on that
}
$serverUser=OC_Util::checkWebserverUser();
//common hint for all file permissons error messages
$permissionsHint="Permissions can usually be fixed by setting the owner of the file or directory to the user the web server runs as ($serverUser)";
//check for correct file permissions
if(!stristr(PHP_OS, 'WIN')){
$permissionsModHint="Please change the permissions to 0770 so that the directory cannot be listed by other users.";
$prems=substr(decoct(@fileperms($CONFIG_DATADIRECTORY_ROOT)),-3);
if(substr($prems,-1)!='0'){
OC_Helper::chmodr($CONFIG_DATADIRECTORY_ROOT,0770);
clearstatcache();
$prems=substr(decoct(@fileperms($CONFIG_DATADIRECTORY_ROOT)),-3);
if(substr($prems,2,1)!='0'){
$errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY_ROOT.') is readable from the web<br/>','hint'=>$permissionsHint);
$errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY_ROOT.') is readable for other users<br/>','hint'=>$permissionsModHint);
}
}
if( OC_Config::getValue( "enablebackup", false )){
......@@ -231,7 +224,7 @@ class OC_Util {
clearstatcache();
$prems=substr(decoct(@fileperms($CONFIG_BACKUPDIRECTORY)),-3);
if(substr($prems,2,1)!='0'){
$errors[]=array('error'=>'Data directory ('.$CONFIG_BACKUPDIRECTORY.') is readable from the web<br/>','hint'=>$permissionsHint);
$errors[]=array('error'=>'Data directory ('.$CONFIG_BACKUPDIRECTORY.') is readable for other users<br/>','hint'=>$permissionsModHint);
}
}
}
......@@ -257,6 +250,24 @@ class OC_Util {
return $errors;
}
/**
* Try to get the username the httpd server runs on, used in hints
*/
public static function checkWebserverUser(){
$stat=stat($_SERVER['DOCUMENT_ROOT']);
if(is_callable('posix_getpwuid')){
$serverUser=posix_getpwuid($stat['uid']);
$serverUser='\''.$serverUser['name'].'\'';
}elseif(exec('whoami')){
$serverUser=exec('whoami');
}else{
$serverUser='\'www-data\' for ubuntu/debian'; //TODO: try to detect the distro and give a guess based on that
}
return $serverUser;
}
/**
* Check if the user is logged in, redirects to home if not
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment