merged admin, help and settings to settings

This commit is contained in:
Jan-Christoph Borchardt 2011-08-13 04:04:48 +02:00
parent 67156f87e3
commit 4a5ee765cf
50 changed files with 60 additions and 287 deletions

View File

@ -1,26 +0,0 @@
<?php
// Init owncloud
require_once('../../lib/base.php');
// We send json data
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
$username = $_POST["username"];
$password = $_POST["password"];
// Return Success story
if( OC_User::setPassword( $username, $password )){
echo json_encode( array( "status" => "success", "data" => array( "username" => $username )));
}
else{
echo json_encode( array( "status" => "error", "data" => array( "message" => "Unable to change password" )));
}
?>

View File

@ -1,5 +0,0 @@
<?php
OC_App::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
?>

View File

@ -1,3 +0,0 @@
li{color:#888}
li.active{color:#000}
span.version{margin-left:3em;color:#ddd}

View File

@ -1,13 +0,0 @@
form { display:inline; }
td.name, td.password { padding-left:.8em; }
td.password>img, td.remove>img { display:none; cursor:pointer; }
td.password>span { margin-right:1.2em; }
td.password { width:12em; cursor:pointer; }
td.remove { width:1em; }
tr:hover>td.password>span { margin:0; cursor:pointer; }
tr:hover>td.remove>img, tr:hover>td.password>img { display:inline; cursor:pointer; }
tr:hover>td.remove>img { float:right; }
li.selected { background-color:#ddd; }
#content>table { margin-top:6.5em; }
table { width:100%; }

View File

@ -1,19 +0,0 @@
<?php $TRANSLATIONS = array(
"read more" => "læs mere",
"INSTALL" => "INSTALLER",
"Apps Repository" => "Applikation arkiv",
"Cannot connect to apps repository" => "Kan ikke oprette forbindelse til applikations arkivet",
"Name" => "Navn",
"Modified" => "Ændret",
"Administration" => "Administration",
"System Settings" => "System indstillinger",
"Users" => "Brugere",
"Groups" => "Grupper",
"Password" => "Kodeord",
"remove" => "slet",
"Create group" => "Lav gruppe",
"Force new password:" => "Tving ny adgangskode",
"Set" => "Indstil",
"Do you really want to delete user" => "Vil du virkelig slette denne bruger?",
"Do you really want to delete group" => "Vil du virkelig slette denne gruppe?"
);

View File

@ -1,20 +0,0 @@
<?php $TRANSLATIONS = array(
"read more" => "mehr …",
"INSTALL" => "Installieren",
"Apps Repository" => "Anwendungen",
"Cannot connect to apps repository" => "Verbindung fehlgeschlagen",
"Name" => "Name",
"Modified" => "Änderungsdatum",
"Administration" => "Verwaltung",
"System Settings" => "Systemeinstellungen",
"Users" => "Nutzer",
"Groups" => "Gruppen",
"Password" => "Passwort",
"Create" => "Erstellen",
"remove" => "entfernen",
"Create group" => "Gruppe erstellen",
"Force new password:" => "Neues Passwort:",
"Set" => "OK",
"Do you really want to delete user" => "Möchtest du den Nutzer wirklich entfernen?",
"Do you really want to delete group" => "Möchtest du die Gruppe wirklich entfernen?"
);

View File

@ -1,20 +0,0 @@
<?php $TRANSLATIONS = array(
"read more" => "leer más",
"INSTALL" => "Instalar",
"Apps Repository" => "Repositorio de aplicaciones ",
"Cannot connect to apps repository" => "No se pudo conectar con el repositorio de aplicaciones",
"Name" => "Nombre",
"Modified" => "Modificado",
"Administration" => "Administración",
"System Settings" => "Ajustes del Sistema",
"Users" => "Usuarios",
"Groups" => "Grupos",
"Password" => "Contraseña",
"Create" => "Crear",
"remove" => "Eliminar",
"Create group" => "Crear grupo",
"Force new password:" => "Forzar una nueva contraseña",
"Set" => "Aplicar",
"Do you really want to delete user" => "¿Seguro que quieres eliminar este usuario?",
"Do you really want to delete group" => "¿Seguro que quieres eliminar este grupo?"
);

View File

@ -1,20 +0,0 @@
<?php $TRANSLATIONS = array(
"read more" => "en lire plus",
"INSTALL" => "INSTALLATION",
"Apps Repository" => "Répertoire d'applications",
"Cannot connect to apps repository" => "Impossible de se connecter au répertoire d'applications",
"Name" => "Nom",
"Modified" => "Modifié le",
"Administration" => "Administration",
"System Settings" => "Préférences Système",
"Users" => "Utilisateurs",
"Groups" => "Groupes",
"Password" => "Mot de passe",
"Create" => "Créer",
"remove" => "retirer",
"Create group" => "Créer un groupe",
"Force new password:" => "Forcer un nouveau mot de passe :",
"Set" => "Appliquer",
"Do you really want to delete user" => "Voulez-vous réellement supprimer cet utilisateur",
"Do you really want to delete group" => "Voulez-vous réellement supprimer ce groupe"
);

View File

@ -1,19 +0,0 @@
<?php $TRANSLATIONS = array(
"read more" => "Meer informatie",
"INSTALL" => "Installeer",
"Apps Repository" => "Applicatiedatabase",
"Cannot connect to apps repository" => "Kan geen verbinding maken met de applicatiedatabase",
"Name" => "Naam",
"Modified" => "Laatst aangepast",
"Administration" => "Administratie",
"System Settings" => "Systeeminstellingen",
"Users" => "Gebruikers",
"Groups" => "Groepen",
"Password" => "Wachtwoord",
"remove" => "verwijder",
"Create group" => "Groep aanmaken",
"Force new password:" => "Forceer nieuw wachtwoord:",
"Set" => "Ok",
"Do you really want to delete user" => "Wilt u deze gebruiker verwijderen",
"Do you really want to delete group" => "Wilt u deze groep verwijderen"
);

View File

@ -1,19 +0,0 @@
<?php $TRANSLATIONS = array(
"read more" => "czytaj więcej",
"INSTALL" => "INSTALUJ",
"Apps Repository" => "Repozytorium aplikacji",
"Cannot connect to apps repository" => "Nie można połączyć się z repozytorium aplikacji",
"Name" => "Nazwa",
"Modified" => "Zmodyfikowano",
"Administration" => "Administracja",
"System Settings" => "Ustawienia systemowe",
"Users" => "Użytkownicy",
"Groups" => "Grupy",
"Password" => "Hasło",
"remove" => "usuń",
"Create group" => "Utwórz grupę",
"Force new password:" => "Wymuś nowe hasło",
"Set" => "Ustaw",
"Do you really want to delete user" => "Czy naprawdę chcesz usunąć użytkownika",
"Do you really want to delete group" => "Czy naprawdę chcesz usunąć grupę"
);

View File

@ -1,36 +0,0 @@
<?php
/**
* ownCloud
*
* @author Frank Karlitschek
* @copyright 2010 Frank Karlitschek karlitschek@kde.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
require_once('../lib/base.php');
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
exit();
}
OC_App::setActiveNavigationEntry( "administration" );
$tmpl = new OC_Template( "admin", "system", "user" );
$tmpl->printPage();
?>

View File

@ -1,2 +0,0 @@
<h2><?php echo $l->t( 'System Settings' ); ?></h2>
#TBD

View File

@ -14,5 +14,5 @@ OC_App::addNavigationEntry( array(
'id' => 'contacts_index',
'order' => 10,
'href' => OC_Helper::linkTo( 'contacts', 'index.php' ),
'icon' => OC_Helper::imagePath( 'admin', 'users.svg' ),
'icon' => OC_Helper::imagePath( 'settings', 'users.svg' ),
'name' => 'Contacts' ));

View File

@ -1,5 +0,0 @@
<?php
OC_App::register( array( "order" => 1, "id" => "help", "name" => "Help" ));
?>

View File

@ -1,10 +0,0 @@
/* APPS TABLE */
table td.date { width:5em; padding:.5em 1em; text-align:right; }
.preview { padding:3px; text-align:left; }
table td.date { width:11em; color:#555555; }
table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; }
table td.name a { padding:6px; text-decoration:none; color:#555555; }
.type { text-decoration:none; color:#888888; font-size:.8em; }
.description { text-decoration:none; color:#666666; font-size:.9em; }
table#help tr td { white-space:normal; }

View File

@ -1,4 +0,0 @@
<?php $TRANSLATIONS = array(
"Questions and Answers" => "Въпроси и отговори",
"ASK A QUESTION" => "ЗАДАЙТЕ ВЪПРОС"
);

View File

@ -1,4 +0,0 @@
<?php $TRANSLATIONS = array(
"Questions and Answers" => "Spørgsmål og Svar",
"ASK A QUESTION" => "STIL ET SPØRGSMÅL"
);

View File

@ -1,4 +0,0 @@
<?php $TRANSLATIONS = array(
"Questions and Answers" => "Fragen & Antworten",
"ASK A QUESTION" => "Stell eine Frage"
);

View File

@ -1,4 +0,0 @@
<?php $TRANSLATIONS = array(
"Questions and Answers" => "Preguntas y Respuestas",
"ASK A QUESTION" => "Haz una pregunta"
);

View File

@ -1,4 +0,0 @@
<?php $TRANSLATIONS = array(
"Questions and Answers" => "Questions / Réponses",
"ASK A QUESTION" => "Poser une question"
);

View File

@ -1,4 +0,0 @@
<?php $TRANSLATIONS = array(
"Questions and Answers" => "Vraag en Antwoord",
"ASK A QUESTION" => "Stel een vraag"
);

View File

@ -1,4 +0,0 @@
<?php $TRANSLATIONS = array(
"Questions and Answers" => "Pytania i odpowiedzi",
"ASK A QUESTION" => "ZADAJ PYTANIE"
);

View File

@ -52,7 +52,7 @@ class OC_App{
}
// Our very own core apps are hardcoded
foreach( array( 'admin', 'files', 'help', 'settings' ) as $app ){
foreach( array('files', 'settings') as $app ){
require( $app.'/appinfo/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.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" => "core_users", "order" => 2, "href" => OC_Helper::linkTo( "settings", "users.php" ), "name" => $l->t("Users"), "icon" => OC_Helper::imagePath( "settings", "users.svg" )),
array( "id" => "core_apps", "order" => 3, "href" => OC_Helper::linkTo( "settings", "apps.php?installed" ), "name" => $l->t("Apps"), "icon" => OC_Helper::imagePath( "settings", "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.svg" )),
array( "id" => "settings", "order" => 1, "href" => OC_Helper::linkTo( "settings", "index.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" ))
array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "help.php" ), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath( "settings", "help.svg" )),
array( "id" => "settings", "order" => 1, "href" => OC_Helper::linkTo( "settings", "personal.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);

View File

@ -3,35 +3,24 @@
// Init owncloud
require_once('../../lib/base.php');
$l=new OC_L10N('settings');
// We send json data
header("Content-Type: application/jsonrequest");
header( "Content-Type: application/jsonrequest" );
// Check if we are a user
if(!OC_User::isLoggedIn()){
echo json_encode(array("status" => "error", "data" => array("message" => $l->t("Authentication error"))));
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
echo json_encode( array( "status" => "error", "data" => array( "message" => "Authentication error" )));
exit();
}
// Get data
if(!isset($_POST["password"]) && !isset($_POST["oldpassword"])){
echo json_encode(array("status" => "error", "data" => array("message" => $l->t("You have to enter the old and the new password!"))));
exit();
}
$username = $_POST["username"];
$password = $_POST["password"];
// Check if the old password is correct
if(!OC_User::checkPassword($_SESSION["user_id"], $_POST["oldpassword"])){
echo json_encode(array("status" => "error", "data" => array("message" => $l->t("Your old password is wrong!"))));
exit();
// Return Success story
if( OC_User::setPassword( $username, $password )){
echo json_encode( array( "status" => "success", "data" => array( "username" => $username )));
}
// 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"))));
else{
echo json_encode( array( "status" => "error", "data" => array( "message" => "Unable to change password" )));
}
?>

View File

@ -1,5 +1,7 @@
<?php
OC_App::register( array( "id" => "settings", "name" => "Settings" ));
OC_App::register( array( "order" => 1, "id" => "admin", "name" => "Administration" ));
OC_App::register( array( "order" => 1, "id" => "help", "name" => "Help" ));
?>

View File

@ -28,8 +28,9 @@ if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' ))
}
// Load the files we need
OC_Util::addStyle( "admin", "apps" );
OC_Util::addScript( "admin", "apps" );
OC_Util::addStyle( "settings", "settings" );
OC_Util::addScript( "settings", "apps" );
OC_App::setActiveNavigationEntry( "core_apps" );
$registeredApps=OC_App::getAllApps();
$apps=array();
@ -59,7 +60,7 @@ foreach($externalApps as $app){
$tmpl = new OC_Template( "admin", "apps", "user" );
$tmpl = new OC_Template( "settings", "apps", "user" );
$tmpl->assign('apps',$apps);
$tmpl->printPage();

View File

@ -1,4 +1,30 @@
/* PERSONAL */
#passworderror { display:none; }
#passwordchanged { display:none; }
input#identity { width:20em; }
/* USERS */
form { display:inline; }
td.name, td.password { padding-left:.8em; }
td.password>img, td.remove>img { display:none; cursor:pointer; }
td.password>span { margin-right:1.2em; }
td.password { width:12em; cursor:pointer; }
td.remove { width:1em; }
tr:hover>td.password>span { margin:0; cursor:pointer; }
tr:hover>td.remove>img, tr:hover>td.password>img { display:inline; cursor:pointer; }
tr:hover>td.remove>img { float:right; }
li.selected { background-color:#ddd; }
#content>table { margin-top:6.5em; }
table { width:100%; }
/* APPS */
li{color:#888}
li.active{color:#000}
span.version{margin-left:3em;color:#ddd}
/* HELP */
table#help tr td { white-space:normal; }

View File

@ -12,13 +12,13 @@ $page=2;
// Load the files we need
OC_Util::addStyle( "help", "help" );
OC_Util::addStyle( "settings", "settings" );
OC_App::setActiveNavigationEntry( "help" );
$kbe=OC_OCSClient::getKnownledgebaseEntries();
$tmpl = new OC_Template( "help", "index", "user" );
$tmpl = new OC_Template( "settings", "help", "user" );
$tmpl->assign( "kbe", $kbe );
$tmpl->assign( "pagecount", $pagecount );
$tmpl->assign( "page", $page );

View File

Before

Width:  |  Height:  |  Size: 255 B

After

Width:  |  Height:  |  Size: 255 B

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

Before

Width:  |  Height:  |  Size: 474 B

After

Width:  |  Height:  |  Size: 474 B

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 743 B

After

Width:  |  Height:  |  Size: 743 B

View File

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -7,9 +7,9 @@ if( !OC_User::isLoggedIn()){
}
// Highlight navigation entry
OC_App::setActiveNavigationEntry( "settings" );
OC_Util::addScript( "settings", "main" );
OC_Util::addScript( "settings", "personal" );
OC_Util::addStyle( "settings", "settings" );
OC_App::setActiveNavigationEntry( "settings" );
// calculate the disc space
$used=OC_Filesystem::filesize('/');
@ -24,7 +24,7 @@ unset($languages[array_search($lang,$languages)]);
array_unshift($languages,$lang);
// Return template
$tmpl = new OC_Template( "settings", "index", "user");
$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);

View File

@ -14,7 +14,7 @@
</tbody>
</table>
<?php
$url=OC_Helper::linkTo( "help", "index.php" ).'?page=';
$url=OC_Helper::linkTo( "settings", "help.php" ).'?page=';
$pageNavi=OC_Util::getPageNavi($_['pagecount'],$_['page'],$url);
$pageNavi->printPage();
?>

View File

@ -22,7 +22,7 @@ foreach($_["groups"] as $group) {
<td class="name"><?php echo $user["name"]; ?></td>
<td class="password">
<span>●●●●●●●</span>
<img class="svg" src="<?php echo image_path('core','actions/rename.svg')?>"/>
<img class="svg" src="<?php echo image_path('core','actions/rename')?>"/>
</td>
<td class="groups">
<select data-username="<?php echo $user['name'] ;?>" data-user-groups="<?php echo $user['groups'] ;?>" data-placeholder="groups" title="<?php echo $l->t('Groups')?>" multiple="multiple">
@ -33,7 +33,7 @@ foreach($_["groups"] as $group) {
</td>
<td class="remove">
<?php if($user['name']!=OC_User::getUser()):?>
<img alt="Remove" title="<?php echo $l->t('Remove')?>" class='svg' src='<?php echo image_path('core','actions/delete.svg') ?>'/>
<img alt="Remove" title="<?php echo $l->t('Remove')?>" class="svg" src="<?php echo image_path('core','actions/delete') ?>" />
<?php endif;?>
</td>
</tr>

View File

@ -28,8 +28,8 @@ if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' ))
}
// We have some javascript foo!
OC_Util::addScript( 'admin', 'users' );
OC_Util::addStyle( 'admin', 'users' );
OC_Util::addScript( 'settings', 'users' );
OC_Util::addStyle( 'settings', 'settings' );
OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' );
OC_App::setActiveNavigationEntry( 'core_users' );
@ -46,7 +46,7 @@ foreach( OC_Group::getGroups() as $i ){
$groups[] = array( "name" => $i );
}
$tmpl = new OC_Template( "admin", "users", "user" );
$tmpl = new OC_Template( "settings", "users", "user" );
$tmpl->assign( "users", $users );
$tmpl->assign( "groups", $groups );
$tmpl->printPage();