From 25d687f35a3e86e61935d9a68497a9d5c3b94274 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 17 Apr 2011 00:28:44 +0200 Subject: [PATCH 1/9] add OC_GROUP::createGroup(); --- lib/group.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/group.php b/lib/group.php index 18e34c72773..6ea8681c631 100644 --- a/lib/group.php +++ b/lib/group.php @@ -124,4 +124,13 @@ class OC_GROUP { public static function getGroups() { return self::$_backend->getGroups(); } + + /** + * create a new group + * + * @param string $name Name of the group + */ + public static function createGroup($name) { + return self::$_backend->createGroup($name); + } } From 3e28883a9f52a1b840240c0052087f689433c321 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Sun, 17 Apr 2011 00:28:46 +0200 Subject: [PATCH 2/9] make the detail page work (more or less) --- admin/css/apps.css | 22 ++++++++++++++++++++++ admin/templates/app.php | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 admin/templates/app.php diff --git a/admin/css/apps.css b/admin/css/apps.css index 68bd9cf63d3..02bcade3cc2 100644 --- a/admin/css/apps.css +++ b/admin/css/apps.css @@ -40,3 +40,25 @@ table td.name a font-size: 0.8em; } +.description +{ + padding: 6px; + text-decoration: none; + color: #666666; + font-size: 0.9em; +} + + +.install a { + padding:0.2em 0.5em; + border:1px solid #ddd; + -moz-border-radius:15px; + -webkit-border-radius:15px; + border-radius:15px; + text-decoration: none; + font-size:1.5em; color:#666666; + background-color:#F0F0F0; +} +.install a:hover { + background-color:#DDDDDD; +} diff --git a/admin/templates/app.php b/admin/templates/app.php new file mode 100644 index 00000000000..4b5740c2bc4 --- /dev/null +++ b/admin/templates/app.php @@ -0,0 +1,27 @@ + +

+'.$app['typename'].''); ?>
+
+ + + + + + + + +
+ "") { echo('
'); } ?> + "") { echo('
'); } ?> + "") { echo('
'); } ?> +
+ +
+ read more
'); ?> +
INSTALL
+ From a20ace7d359672e1615b0bff1502adeab84680b1 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 17 Apr 2011 00:39:14 +0200 Subject: [PATCH 3/9] fix more strict errors --- 3dparty/MDB2/Driver/pgsql.php | 2 +- 3dparty/MDB2/Driver/sqlite.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/3dparty/MDB2/Driver/pgsql.php b/3dparty/MDB2/Driver/pgsql.php index 51063247901..6108f18dec1 100644 --- a/3dparty/MDB2/Driver/pgsql.php +++ b/3dparty/MDB2/Driver/pgsql.php @@ -343,7 +343,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common * @access public * @since 2.1.1 */ - static function setTransactionIsolation($isolation) + static function setTransactionIsolation($isolation, $options = array()) { $this->debug('Setting transaction isolation level', __FUNCTION__, array('is_manip' => true)); switch ($isolation) { diff --git a/3dparty/MDB2/Driver/sqlite.php b/3dparty/MDB2/Driver/sqlite.php index fa74d6e7d2b..061b9c67aaa 100644 --- a/3dparty/MDB2/Driver/sqlite.php +++ b/3dparty/MDB2/Driver/sqlite.php @@ -299,7 +299,7 @@ class MDB2_Driver_sqlite extends MDB2_Driver_Common * @access public * @since 2.1.1 */ - static function setTransactionIsolation($isolation) + static function setTransactionIsolation($isolation,$options=array()) { $this->debug('Setting transaction isolation level', __FUNCTION__, array('is_manip' => true)); switch ($isolation) { From 3263b80ea94a2d3c8a7d68d8190a93db198e2203 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 17 Apr 2011 00:45:05 +0200 Subject: [PATCH 4/9] first-run wizzard wip --- img/task-attention.png | Bin 0 -> 1696 bytes index.php | 7 +++ js/js.js | 18 ++++++ lib/installer.php | 123 +++++++++++++++++++++++++++++++++++++ templates/error.php | 2 +- templates/installation.php | 52 ++++++++++++++++ 6 files changed, 201 insertions(+), 1 deletion(-) create mode 100644 img/task-attention.png create mode 100644 lib/installer.php create mode 100644 templates/installation.php diff --git a/img/task-attention.png b/img/task-attention.png new file mode 100644 index 0000000000000000000000000000000000000000..35a112e9d53429da221cfd0b7110a6eae0594b85 GIT binary patch literal 1696 zcmV;R24DG!P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2igW5 z3kndqPxu4?00tmQL_t(o!_}5uY#m1#hM#X|&)IX1&#_Np$8l^@f*X>^0otaDX{i!w zm6GsNi4v(0QPGwPiXx~&XnKK!TBP1^!v%NzU2s7}5ki#;5kjH-)Cp-RrKE(UF$q>m z{%psN&+hU0+1>fL*mZpDI;oQqBvu;D?Ci|E@4nyr%?$iMKB|lK?Z3XY+-nB^9>A~B zm$!S=xQQ$ovT|B(*FcYhZ1`U&aFBdFyzCqCnSGV;(7k~kkRR${r|Wvwa;^#Z`BeUl zb7ypR>M4r17iHC>g~kPalt^~!am)=RAol^o(h*&huT$Kdb)uY@woT&nJwSMo-2`Se zfIfYr6!kw?k1|l{nYrJ9>A3wMSy#xGn#Pr$jZCL$*d3w zry=r@<|Q)ypVx3ocTsZsuaqh8h=BSCq4N=2jqlE^`HB*af%dpAT30=^v_`o~R&=v$(4t)F`lD#C6s!RfQ!H&|lyX z*-zS<9W*O;f}P~_g@Cx>qm6)L{|dnPnBr!M<9sJo`Lh01a!XNRX$tf?tD=hTcDg@- zXalT|s86FB(5U)2HUL|J@ZY%I_iM8fKSbmV0O-%&Apt#wA!J8bciv~Z?gcvywt|=O zsrgkJ)hb>#NW7o{rm#w4r?aR&kLy7S^1yWxxSY#V=BDN)`?$OEK9zVHmqMt&{pnmrnPeT#VBV?nC`fy~I_j${EAof8*AO<2# zN0X*+Pz~uQ*C1{t-!w#Q9pjA)`Cii)JNJb5L3ssqdPxNIcOXMRWY*Qs$6xX`Y*#T> za0_7TK$u9Bap));!bYC7jLxb0ZBXOv1!Wl8PyWBvVA%S5iBDVQ+q&{0a2p zRXw2l)A>brWALVZIKQT(l1uRLA}|vmXFyIu{12kwDAZ4aJr8ar8JADT=RghQHsooH zv6Y&+M^7PFRX{!tdYD3eB>Jj)?=EIKN9WTt>8}Z((7#dXC?{=l3u6hQVDh85J!`1` zb98T8!Tmi%WAiZIa?g9+{m|rr=!MeI`fR5BhTxasK-B+ZI?&Sg+K)O3#IC7(H>{ndN0%chTsC3v}9Xq59opuhYTZ!3@l6gvMuA> zL@{wdawFt63^4uo_zC(<&!QgCXAnGhaONcU7w>QtNf&7?vx}GD`EOy~HC->XuoYh-C zTpoHc0lJd;W=k84zn%!VV!*;o3S?Ud&$i>azTo&>I`hYa=ei#=cgfB1Xrf)4^u=NE z)@55Q+5j=>gjND+>Rk?616K5=W}aH0&|(DA_u_4#1jC)Z*vSFiLrP$VxUiNgvb>^=mCDU3*F+?l1FmMcN+Tc608&M^Gv#odLN0;^=ezJb5gNWFzQ7r%c`s;>o*kjij+woCSY5 z+pjIa&SjE1kMtaNI!B=yPf~MU;bnVXc3n0h$Svuv^-YBBzy$D{WW&LxIbLX4d{)*; q;I+h*Z`tHqef0k1oRBBy>+~PFvdCaVEHL5#00000){ OC_TEMPLATE::printGuestPage( "", "error", array( "errors" => $errors )); +}elseif(isset($_POST['install']) and $_POST['install']=='true'){ + require_once 'installer.php'; +}elseif (!OC_CONFIG::getValue('installed',false)) { + $hasSQLite=is_callable('sqlite_open'); + $hasMySQL=is_callable('mysql_connect'); + $datadir=OC_CONFIG::getValue('datadir',$SERVERROOT.'/data'); + OC_TEMPLATE::printGuestPage( "", "installation",array('hasSQLite'=>$hasSQLite,'hasMySQL'=>$hasMySQL,'datadir'=>$datadir)); }elseif( OC_USER::isLoggedIn()){ if( isset($_GET["logout"]) and ($_GET["logout"]) ){ OC_USER::logout(); diff --git a/js/js.js b/js/js.js index 244433184f8..86f5885ce62 100644 --- a/js/js.js +++ b/js/js.js @@ -9,4 +9,22 @@ $(document).ready(function() { $('#user_menu').slideToggle(250); return false; }); + + //hide the advanced config + $('#advanced_options').hide(); + $('#use_mysql').hide(); + + // Sets advanced_options link behaviour : + $('#advanced_options_link').click(function() { + $('#advanced').toggleClass('userLinkOn'); + $('#advanced_options').slideToggle(250); + return false; + }); + + $('#mysql').click(function() { + $('#use_mysql').slideDown(250); + }); + $('#sqlite').click(function() { + $('#use_mysql').slideUp(250); + }); }); diff --git a/lib/installer.php b/lib/installer.php new file mode 100644 index 00000000000..a87e7541fc4 --- /dev/null +++ b/lib/installer.php @@ -0,0 +1,123 @@ +0){ + OC_TEMPLATE::printGuestPage( "", "error", array( "errors" => $errors )); + }else{ + header( "Location: $WEBROOT"); + exit(); + } +} + +class OC_INSTALLER{ + public static function install($options){ + $error=array(); + $dbtype=$options['dbtype']; + if(empty($options['login'])){ + $error[]=array('error'=>'username not set'); + }; + if(empty($options['pass'])){ + $error[]=array('error'=>'password not set'); + }; + if(empty($options['directory'])){ + $error[]=array('error'=>'data directory not set'); + }; + if($dbtype=='mysql'){//mysql needs more config options + if(empty($options['dbuser'])){ + $error[]=array('error'=>'database user directory not set'); + }; + if(empty($options['dbpass'])){ + $error[]=array('error'=>'database password directory not set'); + }; + if(empty($options['dbname'])){ + $error[]=array('error'=>'database name directory not set'); + }; + if(empty($options['dbhost'])){ + $error[]=array('error'=>'database host directory not set'); + }; + if(!isset($options['dbtableprefix'])){ + $error[]=array('error'=>'database table prefix directory not set'); + }; + } + if(count($error)==0){ //no errors, good + $username=$options['login']; + $password=$options['pass']; + $datadir=$options['directory']; + + //write the config file + OC_CONFIG::setValue('datadirectory',$datadir); + OC_CONFIG::setValue('dbtype',$dbtype); + if($dbtype=='mysql'){ + $dbuser=$options['dbuser']; + $dbpass=$options['dbpass']; + $dbname=$options['dbname']; + $dbhost=$options['dbhost']; + $dbtableprefix=$options['dbtableprefix']; + OC_CONFIG::setValue('dbname',$dbname); + OC_CONFIG::setValue('dbhost',$dbhost); + OC_CONFIG::setValue('dbtableprefix',$dbtableprefix); + + //check if the database user has admin right + $connection=mysql_connect($dbhost, $dbuser, $dbpass); + if(!$connection) { + $error[]=array('error'=>'mysql username and/or password not valid','you need to enter either an existing account, or the administrative account if you wish to create a new user for ownCloud'); + }else{ + $query="SELECT user FROM mysql.user WHERE user='$dbuser'";//this should be enough to check for admin rights in mysql + if(mysql_query($query,$connection)){ + //use the admin login data for the new database user + self::createDBUser($username,$password); + OC_CONFIG::setValue('dbuser',$username); + OC_CONFIG::setValue('dbpass',$password); + }else{ + OC_CONFIG::setValue('dbuser',$dbuser); + OC_CONFIG::setValue('dbpass',$dbpass); + + //create the database + self::createDatabase($dbname,$dbuser); + } + } + mysql_close($connection); + } + OC_USER::createUser($username,$password); + OC_GROUP::createGroup('admin'); + OC_GROUP::addToGroup($username,'admin'); + OC_CONFIG::setValue('installed',true); + } + return $error; + } + + public static function createDatabase($name,$adminUser,$adminPwd){//TODO refactoring this + $CONFIG_DBHOST=$options['host']; + $CONFIG_DBNAME=$options['name']; + $CONFIG_DBUSER=$options['user']; + $CONFIG_DBPWD=$options['pass']; + $CONFIG_DBTYPE=$options['type']; + //we cant user OC_BD functions here because we need to connect as the administrative user. + $query="CREATE DATABASE IF NOT EXISTS `$name`"; + $result = mysql_query($query,$connection); + if (!$result) { + $entry='DB Error: "'.mysql_error($connection).'"
'; + $entry.='Offending command was: '.$query.'
'; + echo($entry); + } + $query="GRANT ALL PRIVILEGES ON `$name` . * TO '$user'"; + $result = mysql_query($query,$connection); + if (!$result) { + $entry='DB Error: "'.mysql_error($connection).'"
'; + $entry.='Offending command was: '.$query.'
'; + echo($entry); + } + } + + private static function createDBUser($name,$password){ + //we need to create 2 accounts, one for global use and one for local user. if we don't speccify the local one, + // the anonymous user would take precedence when there is one. + $query="CREATE USER 'name'@'localhost' IDENTIFIED BY '$password'"; + $result = mysql_query($query,$connection); + $query="CREATE USER '$name'@'%' IDENTIFIED BY '$password'"; + $result = mysql_query($query,$connection); + } +} + +?> \ No newline at end of file diff --git a/templates/error.php b/templates/error.php index 5b71c1ef751..ae3f029708f 100644 --- a/templates/error.php +++ b/templates/error.php @@ -9,7 +9,7 @@

  • -

    +

  • diff --git a/templates/installation.php b/templates/installation.php new file mode 100644 index 00000000000..6e555e843f2 --- /dev/null +++ b/templates/installation.php @@ -0,0 +1,52 @@ + +
    + " alt="ownCloud" /> +
    + +
    +

    +

    +
    +
    + + MySQL Database +

    +

    +

    + +
    +
    + Advanced ▾ +
    +

    + +

    +

    +

    +
    +

    +

    +

    + + + + + + + + +

    +

    +
    + +
    +
    +
    +

    +
    +
    +
    \ No newline at end of file From 2df6e15fcaba3387ff6ed715a39807e3ca898667 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Sat, 16 Apr 2011 23:29:54 +0200 Subject: [PATCH 5/9] this is now HTML5 --- templates/layout.admin.php | 9 ++------- templates/layout.guest.php | 9 ++------- templates/layout.user.php | 9 ++------- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/templates/layout.admin.php b/templates/layout.admin.php index 52912f48767..68b1a9e75e4 100644 --- a/templates/layout.admin.php +++ b/templates/layout.admin.php @@ -1,10 +1,5 @@ - - - + + ownCloud diff --git a/templates/layout.guest.php b/templates/layout.guest.php index 8d567759ffc..d86da0610f5 100644 --- a/templates/layout.guest.php +++ b/templates/layout.guest.php @@ -1,10 +1,5 @@ - - - + + ownCloud diff --git a/templates/layout.user.php b/templates/layout.user.php index 0ee49623151..7c1bfe5ad2a 100644 --- a/templates/layout.user.php +++ b/templates/layout.user.php @@ -1,10 +1,5 @@ - - - + + ownCloud From 23717b74c7a7cda5c5cb5d480b5feb9c8c5a4ec8 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Sun, 17 Apr 2011 00:37:27 +0200 Subject: [PATCH 6/9] CSS hover magic --- css/styles.css | 32 ++++++++++++++++++-------------- templates/layout.admin.php | 12 ++++++------ templates/layout.guest.php | 5 +---- templates/layout.user.php | 12 ++++++------ 4 files changed, 31 insertions(+), 30 deletions(-) diff --git a/css/styles.css b/css/styles.css index 709234543af..9d0a710adba 100644 --- a/css/styles.css +++ b/css/styles.css @@ -13,8 +13,9 @@ form p { padding:0.5em 4em 0.5em 0.5em; text-align:left; } form p.form_footer { margin:1em 0 0 0; text-align:right; } form label { cursor:pointer; } form input { padding:0.2em; border:1px solid #ddd; font-size:1.2em; } -/*form input[type="submit"] { padding:0.1em 1em; border:1px solid #999; font-weight:bold; font-size:0.9em; cursor:pointer; }*/ -form input[type="submit"]:hover { border:1px solid #999; background-color:#ccc; } +form input[type="submit"] { padding:0.1em 1em; border:1px solid #999; font-weight:bold; font-size:0.9em; cursor:pointer; } +form input[type="submit"]:hover, form input[type="submit"]:focus { border:1px solid #999; background-color:#999; outline:0; } +form input[type="submit"]:active { outline:0; } fieldset { padding:1em; background-color:#f7f7f7; border:1px solid #ddd; } legend { padding:0 0.5em; font-size:1.2em; } @@ -22,7 +23,7 @@ div.controls { width:91%; margin:1em 1em 1em 2em; padding:0.5em 0; background-co /* LOG IN SCREEN ------------------------------------------------------------ */ body.login { background-image:none; background-color:#ddd; } -body.login p.info { width:640px; margin:4em auto; padding:1em 1em 1em 4em; background-color:#eee; background-image:url('../img/help_about.png'); background-position:0.8em 0.8em; background-repeat:no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } +body.login p.info { width:16em; margin:4em auto; padding:1em; background-color:#eee; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } #login { margin:0 auto 0 auto; padding:2em 0 0 0; background-image:url('../img/header_background2.png'); background-position:left 0; background-repeat:repeat-x; background-color:#eee; text-align:center; } #login form { margin:2.5em auto 0 auto; padding:0 0 1.5em 0; text-align:center; border-bottom:1px solid #fff; } #login h1 { margin:0; padding:2.5em 0 0 0; border:0; text-align:center; text-transform:lowercase; font-size:1.5em; } @@ -30,22 +31,23 @@ body.login p.info { width:640px; margin:4em auto; padding:1em 1em 1em 4em; backg #login fieldset p { margin:1em 0 0 0; padding:0; text-align:center; } #login label { font-size:1.2em; color:#fff; } #login input { width:8em; margin:0.1em; padding:0.2em 0.5em; border:1px solid #ddd; -moz-border-radius:15px; -webkit-border-radius:15px; border-radius:15px; font-size:2em; color:#666; } +#login input:hover, #login input:focus { outline:0; } #login input[type=submit] { width:5em; border:1px solid #ddd; background-color:#fff; font-size:2em; } +#login input[type=submit]:hover, #login input[type=submit]:focus { background-color:#ccc; outline:0; } -/* USER MENU ---------------------------------------------------------------- */ -#user { float:right; margin:1em 5em 1em 0; background-image:url('../img/drop-arrow.png'); background-repeat:no-repeat; background-position:right center; color:#fff; } -#user.userLinkOn { background-color:#39577c; } -#user_menu_link { display:block; padding:0.5em 2em 0.5em 1em; font-weight:bold; } -#user_menu_link, #user_menu a { text-decoration:none; color:#fff; } -#user_menu { position:absolute; z-index:500; right:6.5em; top:45px; list-style-type:none; background-color:#39577c; } -#user_menu a { display:block; padding:0.5em 5em 0.5em 1em; background-color:transparent; } -#user_menu a:hover { background-color:#1d2d42; } +/* USER MENU ---------------------------------------------------------------- */ +#metanav { float:right; position:relative; top:1.5em; list-style:none; margin:0; padding:0; } +#metanav li { display:inline; } +#metanav li a { padding:1em; } +#metanav li a:hover, #metanav li a:focus { background:rgba(0,0,0,.5); -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; outline:0; box-shadow:#444 0 1px 0; -moz-box-shadow:#444 0 1px 0; -webkit-box-shadow:#444 0 1px 0; } +#metanav li a img { vertical-align:middle; } /* PLUGINS MENU ------------------------------------------------------------- */ #plugins { float:left; width:200px; padding:0; } #plugins ul { list-style-type:none; border-top:1px solid #ccc; } #plugins a { display:block; padding:0.5em 0.5em 0.5em 3em; background-position:1.5em center; background-repeat:no-repeat; border-bottom:1px solid #ddd; border-top:1px solid #fff; text-decoration:none; font-size:1.2em; color:#666; } -#plugins a:hover, #plugins a.selected { background-color:#ccc; border-top:1px solid #ccc; border-bottom:1px solid #ccc; color:#000; } +#plugins a:hover, #plugins a:focus, #plugins a.selected { background-color:#ccc; border-top:1px solid #ccc; border-bottom:1px solid #ccc; color:#000; outline:0; } +#plugins a:active { outline:0; } #plugins .files { background-image:url('../img/files.png'); } #plugins .sharing { background-image:url('../img/sharing.png'); } #plugins .galleries { background-image:url('../img/galleries.png'); } @@ -63,7 +65,8 @@ table td.date { width:11em; } table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; } table td.filename a { display:block; background-image:url('../img/file.png'); text-decoration:none; } table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:0.5em 0.5em 0.5em 3em; background-position:1em center; background-repeat:no-repeat; } -table td.filename a:hover { text-decoration:underline; } +table td.filename a:hover, table td.filename a:focus { text-decoration:underline; outline:0; } +table td.filename a:active { outline:0; } table em { font-weight:bold; } table td.filename a.folder-up { background-image:url('../img/back.png'); font-style:italic; } table td.filename a.folder { background-image:url('../img/folder.png'); } @@ -90,7 +93,8 @@ p.nav a img { height:16px; vertical-align:text-top; } /* ACTIONS BAR */ p.actions { padding:0; } p.actions a { padding:0.5em 0.5em 0.5em 3em; background-position:1em center; background-repeat:no-repeat; background-image:url('../img/action.png'); border-right:1px solid #eee; text-decoration:none; color:#333; } -p.actions a:hover { background-color:#eee; color:#000; } +p.actions a:hover, p.actions a:focus { background-color:#eee; color:#000; outline:0; } +p.actions a:active { outline:0; } p.actions a.new-dir { background-image:url('../img/folder-new.png'); } p.actions a.download { background-image:url('../img/download.png'); } p.actions a.delete { background-image:url('../img/delete.png'); } diff --git a/templates/layout.admin.php b/templates/layout.admin.php index 68b1a9e75e4..e20b7e48ece 100644 --- a/templates/layout.admin.php +++ b/templates/layout.admin.php @@ -16,12 +16,12 @@
    diff --git a/templates/layout.guest.php b/templates/layout.guest.php index d86da0610f5..dc16a1183c9 100644 --- a/templates/layout.guest.php +++ b/templates/layout.guest.php @@ -14,9 +14,6 @@ -

    - ownCloud is an open personal cloud which runs on your personal server.
    - To learn more, please visit owncloud.org. -

    +

    ownCloud is a personal cloud which runs on your own server.

    diff --git a/templates/layout.user.php b/templates/layout.user.php index 7c1bfe5ad2a..1ab2d01d9dd 100644 --- a/templates/layout.user.php +++ b/templates/layout.user.php @@ -16,14 +16,14 @@
    From 7de3ecfe5f5e7eebe88b5eb7027abfa0c73898cd Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Sun, 17 Apr 2011 00:44:51 +0200 Subject: [PATCH 7/9] away with the h1, in with the good stuff --- files/templates/admin.php | 7 ------- files/templates/index.php | 7 ------- help/templates/index.php | 9 +-------- settings/templates/index.php | 34 +++++++++++++++++++++++++++------- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/files/templates/admin.php b/files/templates/admin.php index 811b48af027..65a540ac914 100644 --- a/files/templates/admin.php +++ b/files/templates/admin.php @@ -1,10 +1,3 @@ - -

    Admin

    -
    Allow public folders
    diff --git a/files/templates/index.php b/files/templates/index.php index 94d3769c9ac..49742a98136 100644 --- a/files/templates/index.php +++ b/files/templates/index.php @@ -1,10 +1,3 @@ - -

    Files

    -

    Upload -

    Help

    - -Help. \ No newline at end of file +This is self-explanatory. Why are you here? diff --git a/settings/templates/index.php b/settings/templates/index.php index 106d313c014..910437fefc9 100644 --- a/settings/templates/index.php +++ b/settings/templates/index.php @@ -1,8 +1,28 @@ - -

    Settings

    + +
    + Account information +
     
    +

    You're currently using 72% (7.2GB) of your 10GB space.

    +
    + -Welcome to the settings! Bla bla bla \ No newline at end of file +
    +
    + User settings +

    + + +

    +

    + + +

    +

    + + +

    + +
    +
    From ca04b33abebce8ac21b561882761b4467302639d Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Sun, 17 Apr 2011 00:53:10 +0200 Subject: [PATCH 8/9] first step on online ocs knowledgebase integration --- help/index.php | 21 +++------------------ help/templates/index.php | 18 +++++++++++++++++- lib/ocsclient.php | 23 +++++++++++++++++++++++ plugins/publiclink/plugin.xml | 17 ----------------- 4 files changed, 43 insertions(+), 36 deletions(-) delete mode 100755 plugins/publiclink/plugin.xml diff --git a/help/index.php b/help/index.php index dafbd05cf33..fe20c1c4ab5 100644 --- a/help/index.php +++ b/help/index.php @@ -8,27 +8,12 @@ if( !OC_USER::isLoggedIn()){ } OC_APP::setActiveNavigationEntry( "help" ); -$settings = array(); -// Do the work ... -if( $_POST["submit"] ) -{ - if( $_POST["newpassword"] != $_POST["newpasswordconfirm"] ){ - // Say "Passwords not equal" - } - else{ - if( OC_USER::checkPassword( $_SESSION["username"], $_POST["password"] )){ - // Set password - OC_USER::setPassord( $_SESSION["username"], $_POST["newpassword"] ); - } - else{ - // Say "old password bad" - } - } -} +$kbe=OC_OCSCLIENT::getKnownledgebaseEntries(); + $tmpl = new OC_TEMPLATE( "help", "index", "user" ); -$tmpl->assign( "settings", $settings ); +$tmpl->assign( "kbe", $kbe ); $tmpl->printPage(); ?> diff --git a/help/templates/index.php b/help/templates/index.php index 19b0fa8e7fa..89674e01874 100644 --- a/help/templates/index.php +++ b/help/templates/index.php @@ -1 +1,17 @@ -This is self-explanatory. Why are you here? + +

    Help

    + + + + + + + + + + +
    "") { echo(''); } ?> " title="">
    '.$kb['description'].''); ?>
    diff --git a/lib/ocsclient.php b/lib/ocsclient.php index 921bd5489a2..9f6a79e7479 100644 --- a/lib/ocsclient.php +++ b/lib/ocsclient.php @@ -114,6 +114,29 @@ class OC_OCSCLIENT{ return $app; } + /** + * @brief Get all the knowledgebase entries from the OCS server + * @returns array with q and a data + * + * This function returns a list of all the knowledgebase entries from the OCS server + */ + public static function getKnownledgebaseEntries(){ + $url='http://api.opendesktop.org/v1/knowledgebase/data?page=0&pagesize=10'; + + $kbe=array(); + $xml=file_get_contents($url); + $data=simplexml_load_string($xml); + + $tmp=$data->data->content; + for($i = 0; $i < count($tmp); $i++) { + $kb=array(); + $kb['id']=$tmp[$i]->id; + $kb['name']=$tmp[$i]->name; + $kb['description']=$tmp[$i]->description; + $kbe[]=$kb; + } + return $kb; + } diff --git a/plugins/publiclink/plugin.xml b/plugins/publiclink/plugin.xml deleted file mode 100755 index 75abed6cf08..00000000000 --- a/plugins/publiclink/plugin.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - publiclink - Simple file sharing by creating a public link to a file - 0.1 - AGPL - Robin Appelman - 1.1 - - - lib_public.php - - - db_structure.xml - - From 2940f818b4066214137c1c7a89d4327cd17f070e Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Sun, 17 Apr 2011 01:02:56 +0200 Subject: [PATCH 9/9] ups. restore robins file ;-) --- plugins/publiclink/plugin.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 plugins/publiclink/plugin.xml diff --git a/plugins/publiclink/plugin.xml b/plugins/publiclink/plugin.xml new file mode 100644 index 00000000000..75abed6cf08 --- /dev/null +++ b/plugins/publiclink/plugin.xml @@ -0,0 +1,17 @@ + + + + publiclink + Simple file sharing by creating a public link to a file + 0.1 + AGPL + Robin Appelman + 1.1 + + + lib_public.php + + + db_structure.xml + +