From aae6881494af7ada98301667c133272a345ef8f0 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sun, 25 Sep 2011 22:47:29 +0200 Subject: [PATCH 01/87] Move display of login page to function in OC_Util --- index.php | 14 +++----------- lib/util.php | 7 +++++++ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/index.php b/index.php index 63ffba135ae..bb1e370d241 100644 --- a/index.php +++ b/index.php @@ -63,7 +63,7 @@ elseif(isset($_COOKIE["oc_remember_login"]) && $_COOKIE["oc_remember_login"]) { OC_Util::redirectToDefaultPage(); } else { - OC_Template::printGuestPage("", "login", array("error" => true)); + OC_Util::displayLoginPage(array('error' => true)); } } @@ -83,11 +83,7 @@ elseif(isset($_POST["user"]) && isset($_POST['password'])) { OC_Util::redirectToDefaultPage(); } else { - if(isset($_COOKIE["oc_username"])){ - OC_Template::printGuestPage("", "login", array("error" => true, "username" => $_COOKIE["oc_username"])); - }else{ - OC_Template::printGuestPage("", "login", array("error" => true)); - } + OC_Util::displayLoginPage(array('error' => true)); } } @@ -126,11 +122,7 @@ elseif(isset($_GET['resetpassword']) && isset($_GET['token']) && isset($_GET['us // For all others cases, we display the guest page : else { OC_App::loadApps(); - if(isset($_COOKIE["username"])){ - OC_Template::printGuestPage("", "login", array("error" => false, "username" => $_COOKIE["username"])); - }else{ - OC_Template::printGuestPage("", "login", array("error" => false)); - } + OC_Util::displayLoginPage(array('error' => false)); } ?> diff --git a/lib/util.php b/lib/util.php index 51d8cc4d643..39cd1a7afab 100644 --- a/lib/util.php +++ b/lib/util.php @@ -247,6 +247,13 @@ class OC_Util { return $errors; } + public static function displayLoginPage($parameters = array()){ + if(isset($_COOKIE["username"])){ + $parameters["username"] = $_COOKIE["username"]; + } + OC_Template::printGuestPage("", "login", $parameters); + } + /** * Check if the user is logged in, redirects to home if not */ From 950d4e1da498b7c928b5f6e1cbcca8e57ddecb0c Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Sun, 25 Sep 2011 23:33:22 +0200 Subject: [PATCH 02/87] Move lostpassword code to own app --- core/templates/login.php | 2 +- index.php | 32 ------------------- lostpassword/index.php | 25 +++++++++++++++ lostpassword/resetpassword.php | 27 ++++++++++++++++ .../templates/lostpassword.php | 4 +-- .../templates/resetpassword.php | 2 +- 6 files changed, 56 insertions(+), 36 deletions(-) create mode 100644 lostpassword/index.php create mode 100644 lostpassword/resetpassword.php rename {core => lostpassword}/templates/lostpassword.php (90%) rename {core => lostpassword}/templates/resetpassword.php (79%) diff --git a/core/templates/login.php b/core/templates/login.php index 717f6bcabda..c8a86d71a91 100644 --- a/core/templates/login.php +++ b/core/templates/login.php @@ -1,7 +1,7 @@
- t('Lost your password?'); ?> + t('Lost your password?'); ?> diff --git a/index.php b/index.php index bb1e370d241..0db8ad126ce 100644 --- a/index.php +++ b/index.php @@ -87,38 +87,6 @@ elseif(isset($_POST["user"]) && isset($_POST['password'])) { } } -// Someone lost their password: -elseif(isset($_GET['lostpassword'])) { - OC_App::loadApps(); - if (isset($_POST['user'])) { - if (OC_User::userExists($_POST['user'])) { - $token = sha1($_POST['user']+uniqId()); - OC_Preferences::setValue($_POST['user'], "owncloud", "lostpassword", $token); - // TODO send email with link+token - OC_Template::printGuestPage("", "lostpassword", array("error" => false, "requested" => true)); - } else { - OC_Template::printGuestPage("", "lostpassword", array("error" => true, "requested" => false)); - } - } else { - OC_Template::printGuestPage("", "lostpassword", array("error" => false, "requested" => false)); - } -} - -// Someone wants to reset their password: -elseif(isset($_GET['resetpassword']) && isset($_GET['token']) && isset($_GET['user']) && OC_Preferences::getValue($_GET['user'], "owncloud", "lostpassword") === $_GET['token']) { - OC_App::loadApps(); - if (isset($_POST['password'])) { - if (OC_User::setPassword($_GET['user'], $_POST['password'])) { - OC_Preferences::deleteKey($_GET['user'], "owncloud", "lostpassword"); - OC_Template::printGuestPage("", "resetpassword", array("success" => true)); - } else { - OC_Template::printGuestPage("", "resetpassword", array("success" => false)); - } - } else { - OC_Template::printGuestPage("", "resetpassword", array("success" => false)); - } -} - // For all others cases, we display the guest page : else { OC_App::loadApps(); diff --git a/lostpassword/index.php b/lostpassword/index.php new file mode 100644 index 00000000000..0c078343a8d --- /dev/null +++ b/lostpassword/index.php @@ -0,0 +1,25 @@ + false, 'requested' => true)); + } else { + OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => true, 'requested' => false)); + } +} else { + OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => false)); +} diff --git a/lostpassword/resetpassword.php b/lostpassword/resetpassword.php new file mode 100644 index 00000000000..1a6a74e5ff4 --- /dev/null +++ b/lostpassword/resetpassword.php @@ -0,0 +1,27 @@ + true)); + } else { + OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => false)); + } + } else { + OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => false)); + } +} else { + // Someone lost their password + OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => false)); +} diff --git a/core/templates/lostpassword.php b/lostpassword/templates/lostpassword.php similarity index 90% rename from core/templates/lostpassword.php rename to lostpassword/templates/lostpassword.php index 67e34164d08..1c95e0be499 100644 --- a/core/templates/lostpassword.php +++ b/lostpassword/templates/lostpassword.php @@ -1,4 +1,4 @@ - +
t('You will receive a link to reset your password via Email.'); ?> @@ -11,4 +11,4 @@
- \ No newline at end of file + diff --git a/core/templates/resetpassword.php b/lostpassword/templates/resetpassword.php similarity index 79% rename from core/templates/resetpassword.php rename to lostpassword/templates/resetpassword.php index 2f43a93cfb5..888d98e8bdc 100644 --- a/core/templates/resetpassword.php +++ b/lostpassword/templates/resetpassword.php @@ -1,4 +1,4 @@ -
+
t('Your password was reset'); ?> From f14930389505eda61ec4cbcdf59a54e63513802b Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Mon, 26 Sep 2011 21:10:56 +0200 Subject: [PATCH 03/87] Add email field to personal preferences --- settings/ajax/lostpassword.php | 19 +++++++++++++++++++ settings/js/personal.js | 9 +++++++++ settings/personal.php | 3 +++ settings/templates/personal.php | 8 ++++++++ 4 files changed, 39 insertions(+) create mode 100644 settings/ajax/lostpassword.php diff --git a/settings/ajax/lostpassword.php b/settings/ajax/lostpassword.php new file mode 100644 index 00000000000..a2dfc033206 --- /dev/null +++ b/settings/ajax/lostpassword.php @@ -0,0 +1,19 @@ + array( "message" => $l->t("email Changed") ))); +}else{ + OC_JSON::error(array("data" => array( "message" => $l->t("Invalid request") ))); +} + +?> diff --git a/settings/js/personal.js b/settings/js/personal.js index 9578fb2c890..8108da433c8 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -32,6 +32,15 @@ $(document).ready(function(){ }); + $('#lostpassword #email').blur(function(event){ + event.preventDefault(); + OC.msg.startSaving('#lostpassword .msg'); + var post = $( "#lostpassword" ).serialize(); + $.post( 'ajax/lostpassword.php', post, function(data){ + OC.msg.finishedSaving('#lostpassword .msg', data); + }); + }); + $("#languageinput").chosen(); $("#languageinput").change( function(){ diff --git a/settings/personal.php b/settings/personal.php index 05dbda473ac..687b1a7aa34 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -19,6 +19,8 @@ $free=OC_Filesystem::free_space(); $total=$free+$used; $relative=round(($used/$total)*10000)/100; +$email=OC_Preferences::getValue(OC_User::getUser(), 'settings','email',''); + $lang=OC_Preferences::getValue( OC_User::getUser(), 'core', 'lang', 'en' ); $languageCodes=OC_L10N::findAvailableLanguages(); //put the current language in the front @@ -35,6 +37,7 @@ $tmpl = new OC_Template( "settings", "personal", "user"); $tmpl->assign('usage',OC_Helper::humanFileSize($used)); $tmpl->assign('total_space',OC_Helper::humanFileSize($total)); $tmpl->assign('usage_relative',$relative); +$tmpl->assign('email',$email); $tmpl->assign('languages',$languages); $forms=OC_App::getForms('personal'); diff --git a/settings/templates/personal.php b/settings/templates/personal.php index eee5f3979c3..61ee0354b14 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -19,6 +19,14 @@
+
+
+ +
+ t('Fill in an email address to enable password recovery');?> +
+
+
From 676838ac31d2fa98266736e59abfcbf6f30fb03b Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Mon, 26 Sep 2011 21:11:50 +0200 Subject: [PATCH 04/87] Implement mailing of password reset link --- lostpassword/index.php | 11 +++++++++-- lostpassword/templates/email.php | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 lostpassword/templates/email.php diff --git a/lostpassword/index.php b/lostpassword/index.php index 0c078343a8d..6d629a71089 100644 --- a/lostpassword/index.php +++ b/lostpassword/index.php @@ -14,8 +14,15 @@ if (isset($_POST['user'])) { if (OC_User::userExists($_POST['user'])) { $token = sha1($_POST['user']+uniqId()); OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token); - // TODO send email with link+token - $link = OC_Helper::linkTo('lostpassword', 'resetpassword.php', null, true).'?user='.$_POST['user'].'&token='.$token; + $email = OC_Preferences::getValue($_POST['user'], 'lostpassword', 'email', ''); + if (!empty($email)) { + $link = OC_Helper::linkTo('lostpassword', 'resetpassword.php', null, true).'?user='.$_POST['user'].'&token='.$token; + $tmpl = new OC_Template('lostpassword', 'email'); + $tmpl->assign('link', $link); + $msg = $tmpl->fetchPage(); + $l = new OC_L10N('core'); + mail($email, $l->t('Owncloud password reset'), $msg); + } OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => true)); } else { OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => true, 'requested' => false)); diff --git a/lostpassword/templates/email.php b/lostpassword/templates/email.php new file mode 100644 index 00000000000..d146d8e4c37 --- /dev/null +++ b/lostpassword/templates/email.php @@ -0,0 +1 @@ +t('Use the following link to reset your password: {link}')) ?> From 5fbf378d1021da91977caa6c7df9944c353d4786 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Mon, 26 Sep 2011 21:12:18 +0200 Subject: [PATCH 05/87] Small textual update to password recovery templates --- lostpassword/templates/lostpassword.php | 2 +- lostpassword/templates/resetpassword.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lostpassword/templates/lostpassword.php b/lostpassword/templates/lostpassword.php index 1c95e0be499..2c38a1562fe 100644 --- a/lostpassword/templates/lostpassword.php +++ b/lostpassword/templates/lostpassword.php @@ -7,7 +7,7 @@ t('Login failed!'); ?> - +
diff --git a/lostpassword/templates/resetpassword.php b/lostpassword/templates/resetpassword.php index 888d98e8bdc..3ab9dd6543c 100644 --- a/lostpassword/templates/resetpassword.php +++ b/lostpassword/templates/resetpassword.php @@ -1,7 +1,8 @@
- t('Your password was reset'); ?> +

t('Your password was reset'); ?>

+

t('To login page'); ?>

From 8c405a59d80898b56e411f40bfb07456f910cc49 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 28 Sep 2011 23:28:14 +0200 Subject: [PATCH 06/87] little bug fixes in calendar app --- apps/calendar/ajax/neweventform.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/calendar/ajax/neweventform.php b/apps/calendar/ajax/neweventform.php index 7a4c6f469e5..7099ea718e9 100644 --- a/apps/calendar/ajax/neweventform.php +++ b/apps/calendar/ajax/neweventform.php @@ -29,6 +29,9 @@ if($starttime != 'undefined' && !is_nan($starttime) && !$allday){ $startminutes = '00'; }else{ $starttime = date('H'); + if(strlen($starttime) == 2 && $starttime <= 9){ + $starttime = substr($starttime, 1, 1); + } $startminutes = date('i'); } @@ -38,7 +41,18 @@ $endyear = $startyear; $endtime = $starttime; $endminutes = $startminutes; if($endtime == 23) { - $endday++; + if($startday == date(t, mktime($starttime, $startminutes, 0, $startmonth, $startday, $startyear))){ + $datetimestamp = mktime(0, 0, 0, $startmonth, $startday, $startyear); + $datetimestamp = $datetimestamp + 86400; + $endmonth = date("m", $datetimestamp); + $endday = date("d", $datetimestamp); + $endyear = date("Y", $datetimestamp); + }else{ + $endday++; + if($endday <= 9){ + $endday = "0" . $endday; + } + } $endtime = 0; } else { $endtime++; From fbada56054c46a8126e59f1ced5e24d098ebde41 Mon Sep 17 00:00:00 2001 From: Thomas Schmidt Date: Wed, 28 Sep 2011 11:44:36 +0200 Subject: [PATCH 07/87] fix url --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 4ad4f82f304..60b18defd59 100644 --- a/README +++ b/README @@ -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 From 40b47defcb2db807834d524fe208b0f13a287bf0 Mon Sep 17 00:00:00 2001 From: Thomas Schmidt Date: Wed, 28 Sep 2011 11:44:46 +0200 Subject: [PATCH 08/87] enhance errormessages on setup --- lib/util.php | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/lib/util.php b/lib/util.php index c7a2c509800..1ab84569174 100644 --- a/lib/util.php +++ b/lib/util.php @@ -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
','hint'=>$permissionsHint); + $errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY_ROOT.') is readable for other users
','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
','hint'=>$permissionsHint); + $errors[]=array('error'=>'Data directory ('.$CONFIG_BACKUPDIRECTORY.') is readable for other users
','hint'=>$permissionsModHint); } } } @@ -254,6 +247,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 */ From b178310a82e5887f4e093b3132e2f6954024a4fe Mon Sep 17 00:00:00 2001 From: Thomas Schmidt Date: Wed, 28 Sep 2011 11:45:04 +0200 Subject: [PATCH 09/87] ignore netbeans folder --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 33f8e0c524b..e9dbc1e3f62 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,6 @@ RCS/* # eclipse .project .settings + +# netbeans +nbproject From e30220e2874799effac365071a1d9c4975e42102 Mon Sep 17 00:00:00 2001 From: Thomas Schmidt Date: Wed, 28 Sep 2011 11:45:22 +0200 Subject: [PATCH 10/87] media app: show current song, add margin, enable tooltip --- apps/media/css/music.css | 8 ++++++-- apps/media/js/music.js | 3 ++- apps/media/js/player.js | 3 +++ apps/media/js/playlist.js | 2 ++ apps/media/templates/music.php | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/media/css/music.css b/apps/media/css/music.css index ddfe3429830..c4db4e05855 100644 --- a/apps/media/css/music.css +++ b/apps/media/css/music.css @@ -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; } diff --git a/apps/media/js/music.js b/apps/media/js/music.js index c04c579d1ca..cac16ac6ff7 100644 --- a/apps/media/js/music.js +++ b/apps/media/js/music.js @@ -15,7 +15,7 @@ $(document).ready(function(){ PlayList.play(oldSize); PlayList.render(); }); - var button=$(''); + var button=$(''); 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(); }); diff --git a/apps/media/js/player.js b/apps/media/js/player.js index f696b87bbde..693bf2d70bf 100644 --- a/apps/media/js/player.js +++ b/apps/media/js/player.js @@ -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){ diff --git a/apps/media/js/playlist.js b/apps/media/js/playlist.js index cb7f24522a4..c6dc3db2dd4 100644 --- a/apps/media/js/playlist.js +++ b/apps/media/js/playlist.js @@ -5,6 +5,7 @@ PlayList.render=function(){ var item=PlayList.items[i]; var li=$('
  • '); li.append(item.name); + li.attr('class', 'jp-playlist-' + i); var img=$(''); 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(); diff --git a/apps/media/templates/music.php b/apps/media/templates/music.php index 6c8d740cc13..2af18fb03c9 100644 --- a/apps/media/templates/music.php +++ b/apps/media/templates/music.php @@ -17,6 +17,7 @@ +
    From 0fcd765bd5560b4188c7e424082a4ebc1b2a3694 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Wed, 28 Sep 2011 11:47:29 +0200 Subject: [PATCH 11/87] add check for ctype --- lib/util.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/util.php b/lib/util.php index c7a2c509800..4b75b0808e8 100644 --- a/lib/util.php +++ b/lib/util.php @@ -250,6 +250,9 @@ class OC_Util { if(!function_exists('mb_detect_encoding')){ $errors[]=array('error'=>'PHP module mb multibyte not installed.
    ','hint'=>'Please ask your server administrator to install the module.'); } + if(!function_exists('ctype_digit')){ + $errors[]=array('error'=>'PHP module ctype is not installed.
    ','hint'=>'Please ask your server administrator to install the module.'); + } return $errors; } From f2a7f230f14e0f30d9ce7ddcc6ad328ac4b0434f Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Wed, 28 Sep 2011 13:52:26 +0200 Subject: [PATCH 12/87] add status file. useful for external administration. show the ownClopud version at least in the config dialog. --- lib/util.php | 10 +++++++- settings/templates/personal.php | 8 ++++++ status.php | 43 +++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 status.php diff --git a/lib/util.php b/lib/util.php index 51d8cc4d643..dea3168e8fc 100644 --- a/lib/util.php +++ b/lib/util.php @@ -90,7 +90,15 @@ class OC_Util { * @return array */ public static function getVersion(){ - return array(1,90,0); + return array(1,91,0); + } + + /** + * get the current installed version string of ownCloud + * @return string + */ + public static function getVersionString(){ + return '2 beta 2'; } /** diff --git a/settings/templates/personal.php b/settings/templates/personal.php index eee5f3979c3..4406c080edc 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -40,3 +40,11 @@ + +

    + ownCloud + +

    + + + diff --git a/status.php b/status.php new file mode 100644 index 00000000000..01b0d7244cb --- /dev/null +++ b/status.php @@ -0,0 +1,43 @@ +. +* +*/ + +$RUNTIME_NOAPPS = TRUE; //no apps, yet + +require_once('lib/base.php'); + +if(OC_Config::getValue('installed')==1) $installed='true'; else $installed='false'; + + +$txt=' + + '.$installed.' + '.implode('.',OC_Util::getVersion()).' + ownCloud '.OC_Util::getVersionString().' + +'; + +echo($txt); + + + +?> From 18216fe71f778b299585de7cc42a568a5adcfa6c Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Wed, 28 Sep 2011 14:26:48 +0200 Subject: [PATCH 13/87] xml so soooo oldschool. using json now like the cool kids do. --- status.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/status.php b/status.php index 01b0d7244cb..94c8cfce842 100644 --- a/status.php +++ b/status.php @@ -26,18 +26,9 @@ $RUNTIME_NOAPPS = TRUE; //no apps, yet require_once('lib/base.php'); if(OC_Config::getValue('installed')==1) $installed='true'; else $installed='false'; +$values=array('installed'=>$installed,'version'=>implode('.',OC_Util::getVersion()),'versionstring'=>OC_Util::getVersionString()); - -$txt=' - - '.$installed.' - '.implode('.',OC_Util::getVersion()).' - ownCloud '.OC_Util::getVersionString().' - -'; - -echo($txt); - +echo(json_encode($values)); ?> From 98c59605aaf5b1652fded5b44cd404346e78102b Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Wed, 28 Sep 2011 16:05:01 +0200 Subject: [PATCH 14/87] show the syncing and ampache urls on the settings page. not very pretty but otherwise the user has no way to configure the desktop integration --- apps/calendar/templates/settings.php | 3 +++ apps/contacts/appinfo/app.php | 3 +++ apps/contacts/settings.php | 6 ++++++ apps/contacts/templates/settings.php | 7 +++++++ apps/media/appinfo/app.php | 1 + apps/media/settings.php | 6 ++++++ apps/media/templates/settings.php | 7 +++++++ 7 files changed, 33 insertions(+) create mode 100644 apps/contacts/settings.php create mode 100644 apps/contacts/templates/settings.php create mode 100644 apps/media/settings.php create mode 100644 apps/media/templates/settings.php diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php index ac13b2aa402..60b524a535a 100644 --- a/apps/calendar/templates/settings.php +++ b/apps/calendar/templates/settings.php @@ -25,5 +25,8 @@ endif; endforeach;?> +
    + Calendar CalDAV Syncing URL: +
  • diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php index 98416ead2fc..fc7b3769c53 100644 --- a/apps/contacts/appinfo/app.php +++ b/apps/contacts/appinfo/app.php @@ -17,3 +17,6 @@ OC_App::addNavigationEntry( array( 'href' => OC_Helper::linkTo( 'contacts', 'index.php' ), 'icon' => OC_Helper::imagePath( 'settings', 'users.svg' ), 'name' => 'Contacts' )); + + +OC_APP::registerPersonal('contacts','settings'); diff --git a/apps/contacts/settings.php b/apps/contacts/settings.php new file mode 100644 index 00000000000..b88128823a7 --- /dev/null +++ b/apps/contacts/settings.php @@ -0,0 +1,6 @@ +fetchPage(); +?> diff --git a/apps/contacts/templates/settings.php b/apps/contacts/templates/settings.php new file mode 100644 index 00000000000..29e6f159b2a --- /dev/null +++ b/apps/contacts/templates/settings.php @@ -0,0 +1,7 @@ +
    +
    + Contacts
    + CardDAV Syncing URL: +
    +
    +
    diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php index 0d36217bd4d..dd1a830a94b 100644 --- a/apps/media/appinfo/app.php +++ b/apps/media/appinfo/app.php @@ -25,6 +25,7 @@ $l=new OC_L10N('media'); require_once('apps/media/lib_media.php'); OC_Util::addScript('media','loader'); +OC_APP::registerPersonal('media','settings'); OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' )); diff --git a/apps/media/settings.php b/apps/media/settings.php new file mode 100644 index 00000000000..133440a9af6 --- /dev/null +++ b/apps/media/settings.php @@ -0,0 +1,6 @@ +fetchPage(); +?> diff --git a/apps/media/templates/settings.php b/apps/media/templates/settings.php new file mode 100644 index 00000000000..70ee6dbc1ea --- /dev/null +++ b/apps/media/templates/settings.php @@ -0,0 +1,7 @@ +
    +
    + Media
    + Ampache URL: +
    +
    +
    From 8d14c489ebb058f362fb3f675db511d228042e89 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 28 Sep 2011 17:14:37 +0200 Subject: [PATCH 15/87] changed short description and styled unobtrusively --- core/css/styles.css | 4 ++-- core/templates/layout.guest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/css/styles.css b/core/css/styles.css index 343ee4ca42d..41781ec191b 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -61,8 +61,8 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text- /* LOG IN & INSTALLATION ------------------------------------------------------------ */ #body-login { background:#ddd; } -#body-login p.info { width:16em; margin:2em auto; padding:1em; background:#eee; -moz-box-shadow:0 1px 0 #bbb inset; -webkit-box-shadow:0 1px 0 #bbb inset; box-shadow:0 1px 0 #bbb inset; -moz-border-radius:1em; -webkit-border-radius:1em; border-radius:1em; } -#body-login p.info a { font-weight:bold; } +#body-login p.info { width:21em; margin:2em auto; color:#777; text-shadow:#fff 0 1px 0; } +#body-login p.info a { font-weight:bold; color:#777; } #login { min-height:30em; margin:2em auto 0; border-bottom:1px solid #f8f8f8; background:#eee; } #login form { width:18em; margin:2em auto 5em; padding:0; } diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 7e05fce0ecf..96f3d2662fb 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -32,6 +32,6 @@ -

    ownCloud t( 'gives you freedom and control over your own data' ); ?>

    +

    ownCloud: t( 'web services under your control' ); ?>

    From 59d4ddd9051c5aaf80140484767ff274d3ce6630 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 28 Sep 2011 18:43:59 +0200 Subject: [PATCH 16/87] commented out colorfield in edit calendar dialog, because colors aren't implemented yet (it would just confuse the user) --- apps/calendar/templates/part.editcalendar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/calendar/templates/part.editcalendar.php b/apps/calendar/templates/part.editcalendar.php index b5c786f63c1..fe9b1f1e97c 100644 --- a/apps/calendar/templates/part.editcalendar.php +++ b/apps/calendar/templates/part.editcalendar.php @@ -30,13 +30,13 @@ - + );" value="t("Save") : $l->t("Submit"); ?>"> );" value="t("Cancel"); ?>"> From c39c6d36df259980a1f804b4c4cc384640b8cf55 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Wed, 28 Sep 2011 22:11:47 +0200 Subject: [PATCH 17/87] do not use 'URL' but 'address' --- apps/calendar/templates/settings.php | 2 +- apps/contacts/templates/settings.php | 2 +- apps/media/templates/settings.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/calendar/templates/settings.php b/apps/calendar/templates/settings.php index 60b524a535a..4b804e48f5b 100644 --- a/apps/calendar/templates/settings.php +++ b/apps/calendar/templates/settings.php @@ -26,7 +26,7 @@ endforeach;?>
    - Calendar CalDAV Syncing URL: + Calendar CalDAV syncing address:
    diff --git a/apps/contacts/templates/settings.php b/apps/contacts/templates/settings.php index 29e6f159b2a..f5c37c5a044 100644 --- a/apps/contacts/templates/settings.php +++ b/apps/contacts/templates/settings.php @@ -1,7 +1,7 @@
    Contacts
    - CardDAV Syncing URL: + CardDAV syncing address:
    diff --git a/apps/media/templates/settings.php b/apps/media/templates/settings.php index 70ee6dbc1ea..da9346166e4 100644 --- a/apps/media/templates/settings.php +++ b/apps/media/templates/settings.php @@ -1,7 +1,7 @@
    Media
    - Ampache URL: + Ampache address:
    From 1639a1ca49aef77cb1b58364fb928a63fa4a99a0 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 28 Sep 2011 22:20:26 +0200 Subject: [PATCH 18/87] fix persistent playlist for media player --- apps/media/css/player.css | 19 +++++++++++++++++ apps/media/js/loader.js | 9 +++++---- apps/media/js/player.js | 36 +++++++++++++++++---------------- apps/media/js/playlist.js | 1 + apps/media/templates/music.php | 2 +- apps/media/templates/player.php | 16 +++++++++++++++ files/js/fileactions.js | 8 ++++---- 7 files changed, 65 insertions(+), 26 deletions(-) create mode 100644 apps/media/css/player.css create mode 100644 apps/media/templates/player.php diff --git a/apps/media/css/player.css b/apps/media/css/player.css new file mode 100644 index 00000000000..265b305eaed --- /dev/null +++ b/apps/media/css/player.css @@ -0,0 +1,19 @@ +#playercontrols{ + display:inline; + width:7em; + height:1em; + position:fixed; + top:auto; + left:auto; + background:transparent; + box-shadow:none; + -webkit-box-shadow:none; +} +#playercontrols li{ + float:left; +} +#playercontrols a, #playercontrols li{ + margin:0px; + padding:0; + left:0; +} \ No newline at end of file diff --git a/apps/media/js/loader.js b/apps/media/js/loader.js index c6c834d3a31..dff4163897f 100644 --- a/apps/media/js/loader.js +++ b/apps/media/js/loader.js @@ -22,16 +22,17 @@ function addAudio(filename){ function loadPlayer(type,ready){ if(!loadPlayer.done){ + loadPlayer.done=true; + OC.addStyle('media','player'); OC.addScript('media','jquery.jplayer.min',function(){ OC.addScript('media','player',function(){ - $('body').append($('
    ')) - $('#playerPlaceholder').append($('
    ')).load(OC.filePath('media','templates','player.php'),function(){ - loadPlayer.done=true; + var navItem=$('#apps a[href="'+OC.linkTo('media','index.php')+'"]'); + navItem.height(navItem.height()); + navItem.load(OC.filePath('media','templates','player.php'),function(){ PlayList.init(type,ready); }); }); }); - OC.addStyle('media','player'); }else{ ready(); } diff --git a/apps/media/js/player.js b/apps/media/js/player.js index 693bf2d70bf..b3eb5278705 100644 --- a/apps/media/js/player.js +++ b/apps/media/js/player.js @@ -28,18 +28,19 @@ var PlayList={ if(index==null){ index=PlayList.current; } + PlayList.save(); if(index>-1 && index0){ @@ -57,6 +58,7 @@ var PlayList={ if (typeof Collection !== 'undefined') { Collection.registerPlay(); } + PlayList.render(); if(ready){ ready(); } @@ -64,12 +66,12 @@ var PlayList={ }else{ localStorage.setItem(oc_current_user+'oc_playlist_time',time); localStorage.setItem(oc_current_user+'oc_playlist_playing','true'); - PlayList.save(); // so that the init don't lose the playlist +// PlayList.save(); // so that the init don't lose the playlist PlayList.init(items[index].type,null); // init calls load that calls play } } - $(".song").removeClass("collection_playing"); - $(".jp-playlist-" + index).addClass("collection_playing"); + $(".song").removeClass("collection_playing"); + $(".jp-playlist-" + index).addClass("collection_playing"); }, init:function(type,ready){ if(!PlayList.player){ @@ -85,7 +87,7 @@ var PlayList={ PlayList.render(); return false; }); - PlayList.player=$('#controls div.player'); + PlayList.player=$('#jp-player'); } $(PlayList.player).jPlayer({ ended:PlayList.next, @@ -103,7 +105,7 @@ var PlayList={ } }, volume:PlayList.volume, - cssSelectorAncestor:'#controls', + cssSelectorAncestor:'.player-controls', swfPath:OC.linkTo('media','js'), }); }, @@ -130,7 +132,7 @@ var PlayList={ var type=musicTypeFromFile(song.path); var item={name:song.name,type:type,artist:song.artist,album:song.album,length:song.length,playcount:song.playCount}; item[type]=PlayList.urlBase+encodeURIComponent(song.path); - PlayList.items.push(item); + PlayList.items.push(item); } }, addFile:function(path){ @@ -160,14 +162,14 @@ var PlayList={ if(typeof localStorage !== 'undefined' && localStorage){ localStorage.setItem(oc_current_user+'oc_playlist_items',JSON.stringify(PlayList.items)); localStorage.setItem(oc_current_user+'oc_playlist_current',PlayList.current); - if(PlayList.player) { - if(PlayList.player.data('jPlayer')) { - var time=Math.round(PlayList.player.data('jPlayer').status.currentTime); - localStorage.setItem(oc_current_user+'oc_playlist_time',time); - var volume=PlayList.player.data('jPlayer').options.volume*100; - localStorage.setItem(oc_current_user+'oc_playlist_volume',volume); - } - } + if(PlayList.player) { + if(PlayList.player.data('jPlayer')) { + var time=Math.round(PlayList.player.data('jPlayer').status.currentTime); + localStorage.setItem(oc_current_user+'oc_playlist_time',time); + var volume=PlayList.player.data('jPlayer').options.volume*100; + localStorage.setItem(oc_current_user+'oc_playlist_volume',volume); + } + } if(PlayList.active){ localStorage.setItem(oc_current_user+'oc_playlist_active','false'); } diff --git a/apps/media/js/playlist.js b/apps/media/js/playlist.js index c6dc3db2dd4..57180b3be7b 100644 --- a/apps/media/js/playlist.js +++ b/apps/media/js/playlist.js @@ -30,6 +30,7 @@ PlayList.hide=function(){ $(document).ready(function(){ PlayList.parent=$('#leftcontent'); + PlayList.init(); $('#selectAll').click(function(){ if($(this).attr('checked')){ // Check all diff --git a/apps/media/templates/music.php b/apps/media/templates/music.php index 2af18fb03c9..7764a315a8f 100644 --- a/apps/media/templates/music.php +++ b/apps/media/templates/music.php @@ -1,4 +1,4 @@ -
    +