diff --git a/files/admin.php b/files/admin.php
index 7161de6e19..db47bc7c03 100644
--- a/files/admin.php
+++ b/files/admin.php
@@ -28,7 +28,7 @@ require_once('../lib/base.php');
// Check if we are a user
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
- header( "Location: ".OC_Helper::linkTo( "index.php" ));
+ header( "Location: ".OC_Helper::linkTo( "files", "index.php" ));
exit();
}
diff --git a/files/ajax/download.php b/files/ajax/download.php
index 2bbf1df4ec..4c756f9b19 100644
--- a/files/ajax/download.php
+++ b/files/ajax/download.php
@@ -26,7 +26,7 @@ require_once('../../lib/base.php');
// Check if we are a user
if( !OC_User::isLoggedIn()){
- header( "Location: ".OC_Helper::linkTo( "index.php" ));
+ header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
exit();
}
diff --git a/files/appinfo/app.php b/files/appinfo/app.php
index 94cd43ab0a..e8b2f0c316 100644
--- a/files/appinfo/app.php
+++ b/files/appinfo/app.php
@@ -4,6 +4,6 @@ $l=new OC_L10N('files');
OC_App::register( array( "order" => 2, "id" => "files", "name" => "Files" ));
-OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_Helper::linkTo( "files", "index.php" ), "icon" => OC_Helper::imagePath( "files", "home.png" ), "name" => $l->t("Files") ));
+OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 1, "href" => OC_Helper::linkTo( "files", "index.php" ), "icon" => OC_Helper::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") ));
?>
diff --git a/files/css/files.css b/files/css/files.css
index aca612ce1e..8613fd8904 100644
--- a/files/css/files.css
+++ b/files/css/files.css
@@ -11,8 +11,9 @@
#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 { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin-right:1.5em;}
+.file_upload_wrapper #file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; }
-#file_newfolder_name { background-image:url("../img/folder.png"); font-weight:bold; width:8em; }
+#file_newfolder_name { background-image:url('../../core/img/places/folder.svg'); font-weight:bold; width:8em; }
.file_upload_start, .file_upload_filename { font-size:1em; }
#file_newfolder_submit, #file_upload_submit { width:3em; }
.file_upload_target { display:none; }
@@ -20,6 +21,8 @@
.file_upload_start { opacity:0; filter:alpha(opacity=0); z-index:1; position:absolute; left:0; top:0; width:100%; cursor:pointer;}
.file_upload_filename { z-index:100; cursor:pointer;}
+.file_upload_form, .file_upload_wrapper, .file_upload_start, .file_upload_filename, #file_upload_submit { cursor:pointer; }
+
/* FILE TABLE */
span#emptyfolder { position:absolute; margin:10em 0 0 10em; font-size:1.5em; font-weight:bold; color:#888; text-shadow:#fff 0 1px 0; }
table { position:relative; top:37px; width:100%; }
@@ -57,4 +60,4 @@ table thead.fixed {height:2em}
.selectedActions a:hover, a.file_action:hover { background:#fff; -moz-box-shadow:0 0 10px #fff; -webkit-box-shadow:0 0 10px #fff; box-shadow:0 0 10px #fff; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; }
/* add breadcrumb divider to the File item in navigation panel */
-#navigation>ul>li:first-child { background:url('../../core/img/breadcrumb-start.png') no-repeat 12.5em 0px; width:12.5em; padding-right:1em; }
+#navigation>ul>li:first-child { background:url('../../core/img/breadcrumb-start.svg') no-repeat 12.5em 0px; width:12.5em; padding-right:1em; }
diff --git a/files/download.php b/files/download.php
index cc52b930f7..ccd3eb43d8 100644
--- a/files/download.php
+++ b/files/download.php
@@ -26,7 +26,7 @@ require_once('../lib/base.php');
// Check if we are a user
if( !OC_User::isLoggedIn()){
- header( "Location: ".OC_Helper::linkTo( "index.php" ));
+ header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
exit();
}
diff --git a/files/img/file.png b/files/img/file.png
deleted file mode 100644
index 4979044889..0000000000
Binary files a/files/img/file.png and /dev/null differ
diff --git a/files/img/folder.png b/files/img/folder.png
deleted file mode 100644
index 3edbe257a3..0000000000
Binary files a/files/img/folder.png and /dev/null differ
diff --git a/files/js/filelist.js b/files/js/filelist.js
index 4a34385fd0..50a995bf25 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -3,7 +3,7 @@ FileList={
$('#fileList').empty().html(fileListHtml);
},
addFile:function(name,size,lastModified,loading){
- var img=(loading)?'img/loading.gif':'img/file.png';
+ var img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png');
var html='
';
if(name.indexOf('.')!=-1){
var basename=name.substr(0,name.indexOf('.'));
diff --git a/files/js/files.js b/files/js/files.js
index bc040b54d5..950f06a31a 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -12,6 +12,12 @@ $(document).ready(function() {
$('#plugins>ul>li:first-child').data('dir','');
$('#plugins>ul>li:first-child').droppable(crumbDropOptions);
+ // Triggers invisible file input
+ $('#file_upload_button_wrapper').bind('click', function() {
+ $('#file_upload_start').trigger('click');
+ return false;
+ });
+
// Sets the file-action buttons behaviour :
$('tr').live('mouseenter',function(event) {
FileActions.display($(this).children('td.filename'));
diff --git a/files/settings.php b/files/settings.php
index 1f2e9d9868..2bbcb2acd3 100644
--- a/files/settings.php
+++ b/files/settings.php
@@ -27,7 +27,7 @@ require_once('../lib/base.php');
// Check if we are a user
if( !OC_User::isLoggedIn()){
- header( "Location: ".OC_Helper::linkTo( "index.php" ));
+ header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
exit();
}
diff --git a/files/templates/index.php b/files/templates/index.php
index 137c5ce592..008051492d 100644
--- a/files/templates/index.php
+++ b/files/templates/index.php
@@ -5,14 +5,16 @@
-
diff --git a/files/templates/part.list.php b/files/templates/part.list.php
index 8b3823f391..942f749c82 100644
--- a/files/templates/part.list.php
+++ b/files/templates/part.list.php
@@ -7,7 +7,7 @@
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14
if($relative_date_color>200) $relative_date_color = 200; ?>
'>
-
+ |
diff --git a/help/img/help.png b/help/img/help.png
index 487c6e6fd9..2257d144d1 100644
Binary files a/help/img/help.png and b/help/img/help.png differ
diff --git a/help/img/help.svg b/help/img/help.svg
new file mode 100644
index 0000000000..1e07aed852
--- /dev/null
+++ b/help/img/help.svg
@@ -0,0 +1,1758 @@
+
+
+
+
diff --git a/help/index.php b/help/index.php
index 642b213173..7eb0c6b182 100644
--- a/help/index.php
+++ b/help/index.php
@@ -2,7 +2,7 @@
require_once('../lib/base.php');
if( !OC_User::isLoggedIn()){
- header( "Location: ".OC_Helper::linkTo( "index.php" ));
+ header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
exit();
}
diff --git a/lib/app.php b/lib/app.php
index 6a2e307859..e7cf74af85 100644
--- a/lib/app.php
+++ b/lib/app.php
@@ -200,13 +200,13 @@ class OC_App{
public static function getSettingsNavigation(){
$l=new OC_L10N('core');
$admin=array(
- array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "admin", "users.php" ), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath( "admin", "users.png" )),
- array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "admin", "apps.php?installed" ), "name" => $l->t("Apps"), "icon" => OC_Helper::imagePath( "admin", "apps.png" )),
- array( "id" => "files_administration", "order" => 3, "href" => OC_Helper::linkTo( "files", "admin.php" ), "name" => $l->t("Files"), "icon" => OC_Helper::imagePath( "files", "folder.png" )),
+ array( "id" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "admin", "users.php" ), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath( "admin", "users.svg" )),
+ array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "admin", "apps.php?installed" ), "name" => $l->t("Apps"), "icon" => OC_Helper::imagePath( "admin", "apps.svg" )),
+// array( "id" => "files_administration", "order" => 3, "href" => OC_Helper::linkTo( "files", "admin.php" ), "name" => $l->t("Files"), "icon" => OC_Helper::imagePath( "settings", "options.svg" )),
);
$settings=array(
- array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "help", "index.php" ), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath( "help", "help.png" )),
- array( "id" => "settings", "order" => 1, "href" => OC_Helper::linkTo( "settings", "index.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.png" ))
+ array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "help", "index.php" ), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath( "help", "help.svg" )),
+ array( "id" => "settings", "order" => 1, "href" => OC_Helper::linkTo( "settings", "index.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" ))
);
if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
$settings=array_merge($admin,$settings);
diff --git a/lib/crypt.php b/lib/crypt.php
index d75515cf2d..83e6ac4cde 100755
--- a/lib/crypt.php
+++ b/lib/crypt.php
@@ -24,9 +24,10 @@
// Todo:
// Crypt/decrypt button in the userinterface
+// setting if crypto should be on by default
// transparent decrypt/encrpt in filesystem.php
// don't use a password directly as encryption key. but a key which is stored on the server and encrypted with the user password. -> password change faster
-
+// check if the block lenght of the encrypted data stays the same
require_once('Crypt_Blowfish/Blowfish.php');
@@ -38,15 +39,50 @@ class OC_Crypt {
static $encription_extension='.encrypted';
- public static function createkey( $passcode) {
- // generate a random key
- $key=mt_rand(10000,99999).mt_rand(10000,99999).mt_rand(10000,99999).mt_rand(10000,99999);
+ public static function init($login,$password) {
+ $_SESSION['user_password'] = $password; // save the password as passcode for the encryption
+ if(OC_User::isLoggedIn()){
+ // does key exist?
+ if(!file_exists(OC_Config::getValue( "datadirectory").'/'.$login.'/encryption.key')){
+ OC_Crypt::createkey($_SESSION['user_password']);
+ }
+ }
+ }
- // encrypt the key with the passcode of the user
- $enckey=OC_Crypt::encrypt($key,$passcode);
- // Write the file
- file_put_contents( "$SERVERROOT/config/encryption.key", $enckey );
+
+ public static function createkey($passcode) {
+ if(OC_User::isLoggedIn()){
+ // generate a random key
+ $key=mt_rand(10000,99999).mt_rand(10000,99999).mt_rand(10000,99999).mt_rand(10000,99999);
+
+ // encrypt the key with the passcode of the user
+ $enckey=OC_Crypt::encrypt($key,$passcode);
+
+ // Write the file
+ $username=OC_USER::getUser();
+ file_put_contents(OC_Config::getValue( "datadirectory").'/'.$username.'/encryption.key', $enckey );
+ }
+ }
+
+ public static function changekeypasscode( $newpasscode) {
+ if(OC_User::isLoggedIn()){
+ $username=OC_USER::getUser();
+
+ // read old key
+ $key=file_get_contents(OC_Config::getValue( "datadirectory").'/'.$username.'/encryption.key');
+
+ // decrypt key with old passcode
+ $key=OC_Crypt::decrypt($key, $_SESSION['user_password']);
+
+ // encrypt again with new passcode
+ $key=OC_Crypt::encrypt($key,$newpassword);
+
+ // store the new key
+ file_put_contents(OC_Config::getValue( "datadirectory").'/'.$username.'/encryption.key', $key );
+
+ $_SESSION['user_password']=$newpasscode;
+ }
}
/**
@@ -59,7 +95,7 @@ class OC_Crypt {
*/
public static function encrypt( $content, $key) {
$bf = new Crypt_Blowfish($key);
- return($bf->encrypt($contents));
+ return($bf->encrypt($content));
}
diff --git a/lib/helper.php b/lib/helper.php
index fa5163ac26..272f460701 100755
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -89,11 +89,11 @@ class OC_Helper {
}
/**
- * @brief get path to icon of mime type
+ * @brief get path to icon of file type
* @param $mimetype mimetype
* @returns the url
*
- * Returns the path to the image of this mime type.
+ * Returns the path to the image of this file type.
*/
public static function mimetypeIcon( $mimetype ){
global $SERVERROOT;
@@ -103,20 +103,20 @@ class OC_Helper {
// Is it a dir?
if( $mimetype == "dir" ){
- return "$WEBROOT/core/img/places/folder.png";
+ return "$WEBROOT/core/img/places/folder.svg";
}
// Icon exists?
- if( file_exists( "$SERVERROOT/core/img/mimetypes/$mimetype.png" )){
- return "$WEBROOT/core/img/mimetypes/$mimetype.png";
+ if( file_exists( "$SERVERROOT/core/img/filetypes/$mimetype.svg" )){
+ return "$WEBROOT/core/img/filetypes/$mimetype.svg";
}
- //try only the first part of the mimetype
+ //try only the first part of the filetype
$mimetype=substr($mimetype,0,strpos($mimetype,'-'));
- if( file_exists( "$SERVERROOT/core/img/mimetypes/$mimetype.png" )){
- return "$WEBROOT/core/img/mimetypes/$mimetype.png";
+ if( file_exists( "$SERVERROOT/core/img/filetypes/$mimetype.svg" )){
+ return "$WEBROOT/core/img/filetypes/$mimetype.svg";
}
else{
- return "$WEBROOT/core/img/mimetypes/file.png";
+ return "$WEBROOT/core/img/filetypes/file.svg";
}
}
diff --git a/lib/ocsclient.php b/lib/ocsclient.php
index 2d85e71509..1df9e21e60 100644
--- a/lib/ocsclient.php
+++ b/lib/ocsclient.php
@@ -80,15 +80,15 @@ class OC_OCSClient{
$tmp=$data->data->content;
for($i = 0; $i < count($tmp); $i++) {
$app=array();
- $app['id']=$tmp[$i]->id;
- $app['name']=$tmp[$i]->name;
- $app['type']=$tmp[$i]->typeid;
- $app['typename']=$tmp[$i]->typename;
- $app['personid']=$tmp[$i]->personid;
- $app['detailpage']=$tmp[$i]->detailpage;
- $app['preview']=$tmp[$i]->smallpreviewpic1;
+ $app['id']=(string)$tmp[$i]->id;
+ $app['name']=(string)$tmp[$i]->name;
+ $app['type']=(string)$tmp[$i]->typeid;
+ $app['typename']=(string)$tmp[$i]->typename;
+ $app['personid']=(string)$tmp[$i]->personid;
+ $app['detailpage']=(string)$tmp[$i]->detailpage;
+ $app['preview']=(string)$tmp[$i]->smallpreviewpic1;
$app['changed']=strtotime($tmp[$i]->changed);
- $app['description']=$tmp[$i]->description;
+ $app['description']=(string)$tmp[$i]->description;
$apps[]=$app;
}
diff --git a/lib/setup.php b/lib/setup.php
index 192fd13460..c7259d6b8c 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -206,6 +206,7 @@ class OC_Setup {
OC_User::createUser($username, $password);
OC_Group::createGroup('admin');
OC_Group::addToGroup($username, 'admin');
+ OC_User::login($username, $password);
//guess what this does
OC_Installer::installShippedApps(true);
diff --git a/lib/user.php b/lib/user.php
index a2ede8234b..e53ba145c9 100644
--- a/lib/user.php
+++ b/lib/user.php
@@ -193,6 +193,7 @@ class OC_User {
if( $run && self::checkPassword( $uid, $password )){
$_SESSION['user_id'] = $uid;
+ OC_Crypt::init($uid,$password);
OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid ));
return true;
}
diff --git a/lib/util.php b/lib/util.php
index 10cd320977..224b54335b 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -194,7 +194,7 @@ class OC_Util {
global $SERVERROOT;
global $CONFIG_DATADIRECTORY;
- $CONFIG_DATADIRECTORY_ROOT = OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );;
+ $CONFIG_DATADIRECTORY_ROOT = OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
$CONFIG_BACKUPDIRECTORY = OC_Config::getValue( "backupdirectory", "$SERVERROOT/backup" );
$CONFIG_INSTALLED = OC_Config::getValue( "installed", false );
$errors=array();
diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php
index c8c1f74088..750edf1769 100644
--- a/settings/ajax/changepassword.php
+++ b/settings/ajax/changepassword.php
@@ -29,6 +29,7 @@ if( !OC_User::checkPassword( $_SESSION["user_id"], $_POST["oldpassword"] )){
// Change password
if( OC_User::setPassword( $_SESSION["user_id"], $_POST["password"] )){
echo json_encode( array( "status" => "success", "data" => array( "message" => $l->t("Password changed") )));
+ OC_Crypt::changekeypasscode( $_POST["password"]) {
}
else{
echo json_encode( array( "status" => "error", "data" => array( "message" => $l->t("Unable to change password") )));
diff --git a/settings/img/options.png b/settings/img/options.png
new file mode 100644
index 0000000000..c1e6d6b8a7
Binary files /dev/null and b/settings/img/options.png differ
diff --git a/settings/img/options.svg b/settings/img/options.svg
new file mode 100644
index 0000000000..b3c4a32451
--- /dev/null
+++ b/settings/img/options.svg
@@ -0,0 +1,2214 @@
+
+
+
+
diff --git a/settings/img/personal.png b/settings/img/personal.png
index ae22c1c1da..8204028f70 100644
Binary files a/settings/img/personal.png and b/settings/img/personal.png differ
diff --git a/settings/img/personal.svg b/settings/img/personal.svg
new file mode 100644
index 0000000000..6131861999
--- /dev/null
+++ b/settings/img/personal.svg
@@ -0,0 +1,1724 @@
+
+
+
+
diff --git a/settings/index.php b/settings/index.php
index 9669b5b3db..aea3505493 100644
--- a/settings/index.php
+++ b/settings/index.php
@@ -2,7 +2,7 @@
require_once('../lib/base.php');
if( !OC_User::isLoggedIn()){
- header( "Location: ".OC_Helper::linkTo( "index.php" ));
+ header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
exit();
}
|