diff options
-rw-r--r-- | admin/appinfo/app.php | 8 | ||||
-rw-r--r-- | admin/index.php | 14 | ||||
-rw-r--r-- | admin/templates/index.php | 9 | ||||
-rw-r--r-- | admin/templates/users.php | 67 | ||||
-rw-r--r-- | admin/users.php | 11 | ||||
-rw-r--r-- | index.php | 2 | ||||
-rw-r--r-- | lib/Group/database.php | 2 |
7 files changed, 82 insertions, 31 deletions
diff --git a/admin/appinfo/app.php b/admin/appinfo/app.php index a0ee0a0e55b..9e39a052443 100644 --- a/admin/appinfo/app.php +++ b/admin/appinfo/app.php @@ -5,8 +5,10 @@ if( OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' )) { OC_APP::addNavigationEntry( array( "id" => "admin_index", "order" => 1, "href" => OC_HELPER::linkTo( "admin", "index.php" ), "icon" => OC_HELPER::imagePath( "admin", "navicon.png" ), "name" => "Administration" )); } -OC_APP::addAdminPage( array( "order" => 1, "href" => OC_HELPER::linkTo( "admin", "system.php" ), "name" => "System settings" )); -OC_APP::addAdminPage( array( "order" => 2, "href" => OC_HELPER::linkTo( "admin", "users.php" ), "name" => "Users" )); -OC_APP::addAdminPage( array( "order" => 3, "href" => OC_HELPER::linkTo( "admin", "plugins.php" ), "name" => "Plugins" )); +OC_APP::addAdminPage( array( "id" => "core_basic", "order" => 1, "href" => OC_HELPER::linkTo( "admin", "basic.php" ), "name" => "Basic Settings" )); +OC_APP::addAdminPage( array( "id" => "core_system", "order" => 2, "href" => OC_HELPER::linkTo( "admin", "system.php" ), "name" => "System settings" )); +OC_APP::addAdminPage( array( "id" => "core_users", "order" => 3, "href" => OC_HELPER::linkTo( "admin", "users.php" ), "name" => "Users" )); +OC_APP::addAdminPage( array( "id" => "core_apps", "order" => 4, "href" => OC_HELPER::linkTo( "admin", "apps.php" ), "name" => "Apps" )); +OC_APP::addAdminPage( array( "id" => "core_plugins", "order" => 5, "href" => OC_HELPER::linkTo( "admin", "plugins.php" ), "name" => "Plugins" )); ?> diff --git a/admin/index.php b/admin/index.php index 8abef287098..2446ebc50aa 100644 --- a/admin/index.php +++ b/admin/index.php @@ -28,15 +28,21 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' exit(); } -$adminpages = array(); +$apppages = array(); +$syspages = array(); foreach( OC_APP::getAdminPages() as $i ){ - // Do some more work here soon - $adminpages[] = $i; + if( substr( $i["id"], 0, 5 ) == "core_" ){ + $syspages[] = $i; + } + else{ + $apppages[] = $i; + } } $tmpl = new OC_TEMPLATE( "admin", "index", "admin" ); -$tmpl->assign( "adminpages", $adminpages ); +$tmpl->assign( "apppages", $apppages ); +$tmpl->assign( "syspages", $syspages ); $tmpl->printPage(); ?> diff --git a/admin/templates/index.php b/admin/templates/index.php index 9d0ffd84c61..fa32a67eadb 100644 --- a/admin/templates/index.php +++ b/admin/templates/index.php @@ -5,8 +5,15 @@ ?> <h1>Administration</h1> +<h2>System</h2> <ul> - <?php foreach($_["adminpages"] as $i): ?> + <?php foreach($_["syspages"] as $i): ?> + <li><a href="<?php echo $i["href"]; ?>"><?php echo $i["name"]; ?></a></li> + <?php endforeach; ?> +</ul> +<h2>Applications</h2> +<ul> + <?php foreach($_["apppages"] as $i): ?> <li><a href="<?php echo $i["href"]; ?>"><?php echo $i["name"]; ?></a></li> <?php endforeach; ?> </ul> diff --git a/admin/templates/users.php b/admin/templates/users.php index 7aa93baf496..88edc01aef2 100644 --- a/admin/templates/users.php +++ b/admin/templates/users.php @@ -9,36 +9,71 @@ <table> <thead> <tr> - <th></th> <th>Name</th> <th>Groups</th> + <th></th> </tr> <thead> <tbody> <?php foreach($_["users"] as $user): ?> <tr> - <td><input type="checkbox"></td> <td><?php echo $user["name"]; ?></td> <td><?php echo $user["groups"]; ?></td> + <td><a href="" class="edituser-button">edit</a> | <a class="removeuser-button" href="">remove</a></td> </tr> <?php endforeach; ?> </tbody> </table> +<a id="adduser-button" href="">New user</a> + <h2>Groups</h2> -<table> - <thead> - <tr> - <th>Name</th> - <th></th> - </tr> - <thead> - <tbody> - <?php foreach($_["groups"] as $group): ?> +<form> + <table> + <thead> <tr> - <td><?php echo $group["name"]; ?></td> - <td>remove</td> + <th>Name</th> + <th></th> </tr> - <?php endforeach; ?> - </tbody> -</table> + <thead> + <tbody> + <?php foreach($_["groups"] as $group): ?> + <tr> + <td><?php echo $group["name"] ?></td> + <td><a class="removegroup-button" href="">remove</a></td> + </tr> + <?php endforeach; ?> + <tr> + <td><input type="text" name="name" /></td> + <td><input type="submit" /></td> + </tr> + </tbody> + </table> +</form> + +<a id="addgroup-button" href="">Add group</a> + + +<div id="adduser-form" title="Add user"> + <form> + User name<br> + <input type="text" name="name" /><br> + Password<br> + <input type="password" name="password" /> + </form> +</div> + +<div id="edituser-form" title="Force new password"> + <form> + New password for $user<br> + <input type="password" name="password" /> + </form> +</div> + +<div id="removeuser-form" title="Remove user"> + Do you really want to delete user $user? +</div> + +<div id="removegroup-form" title="Remove Group"> + Do you really want to delete group $group? +</div> diff --git a/admin/users.php b/admin/users.php index 4d14c791c3c..312bfba2c52 100644 --- a/admin/users.php +++ b/admin/users.php @@ -28,21 +28,24 @@ if( !OC_USER::isLoggedIn() || !OC_GROUP::inGroup( $_SESSION['user_id'], 'admin' exit(); } +// We have some javascript foo! +OC_UTIL::addScript( "admin", "users" ); + $users = array(); $groups = array(); foreach( OC_USER::getUsers() as $i ){ // Do some more work here soon $ingroups = array(); - foreach( OC_USER::getUserGroups( $i ) as $userGroup){ - $ingroup[] = OC_USER::getGroupName( $userGroup ); + foreach( OC_GROUP::getUserGroups( $i ) as $userGroup ){ + $ingroups[] = $userGroup; } $users[] = array( "name" => $i, "groups" => join( ",", $ingroups )); } -foreach( OC_USER::getGroups() as $i ){ +foreach( OC_GROUP::getGroups() as $i ){ // Do some more work here soon - $groups[] = array( "name" => $i ); + $groups[] = array( "name" => $i["gid"] ); } $tmpl = new OC_TEMPLATE( "admin", "users", "admin" ); diff --git a/index.php b/index.php index 2f56510bfbb..c744f094e67 100644 --- a/index.php +++ b/index.php @@ -24,8 +24,6 @@ require_once( 'lib/base.php' ); require_once( 'appconfig.php' ); require_once( 'template.php' ); -var_dump( $_SESSION ); -//exit; if( OC_USER::isLoggedIn()){ if( $_GET["logout"] ){ OC_USER::logout(); diff --git a/lib/Group/database.php b/lib/Group/database.php index bdf5bbc5c55..e3e6c825b9f 100644 --- a/lib/Group/database.php +++ b/lib/Group/database.php @@ -119,7 +119,7 @@ class OC_GROUP_DATABASE extends OC_GROUP_BACKEND { $groups = array(); while( $row = $result->fetchRow()){ - $groups[] = $row; + $groups[] = $row["gid"]; } return $groups; |