Example #1
0
File: user.php Project: skoning/ums
    public static function listUsers()
    {
        /** @var PDO $db */
        $db = self::$db;
        $all = User::getListUsers();
        ?>
		<table>
		<tr>
			<th>#</th>
			<th>Username</th>
			<th>Firstname</th>
			<th>Lastname</th>
			<th colspan="2">Edit</th>
		</tr>
		<?php 
        foreach ($all as $user) {
            vprintf('
				<tr>
					<td>%1$d</td>
				 	<td>%2$d</td>
					<td>%3$s</td>
					<td>%4$s</td>
					<td><a href="?delete=%1$d">X</a></td>
					<td><a href="?edit=%1$d">Edit</a></td>
				</tr>', array($user->id, $user->username, $user->firstname, $user->lastname));
        }
        echo '</table>';
    }
Example #2
0
 public static function list_users()
 {
     if (Auth::check()) {
         $view = array("bundle_name" => 'panel', "view" => 'users.list', "backend" => false, "panel" => true, "roles" => ["User", "Administrateur"]);
         return View::make($view, ["users" => User::getListUsers("users")]);
     } else {
         $redirection = Config::get('app.base_url') . Config::get('panel.route');
         header("Location: {$redirection}");
     }
 }
Example #3
0
 public static function index()
 {
     $view = array("bundle_name" => 'panel', "view" => 'UserWidget.index', "panel" => true, "roles" => ["Administrateur", "User", "Guest"]);
     \View::importWidget($view, ["users" => \User::getListUsers("users")]);
 }