From acafd6b03f4b92587f3e4ec0af0c46cb3d037ba6 Mon Sep 17 00:00:00 2001 From: Christophe Nowicki Date: Tue, 25 Jan 2005 15:31:39 +0000 Subject: Remove php samples from the lasso repository I'm still working on it. I will release an independant Pear package for Lasso 0.6. The pear package repository is here: https://meuh.dyndns.org/cgi-bin/viewcvs.cgi/lasso_pear/ --- php/Attic/examples/sample-idp/admin_user.php | 306 --------------------------- 1 file changed, 306 deletions(-) delete mode 100644 php/Attic/examples/sample-idp/admin_user.php (limited to 'php/Attic/examples/sample-idp/admin_user.php') diff --git a/php/Attic/examples/sample-idp/admin_user.php b/php/Attic/examples/sample-idp/admin_user.php deleted file mode 100644 index 05767f14..00000000 --- a/php/Attic/examples/sample-idp/admin_user.php +++ /dev/null @@ -1,306 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - require_once 'Log.php'; - require_once 'DB.php'; - require_once 'session.php'; - - $config = unserialize(file_get_contents('config.inc')); - - $number_of_users = 5; - - // connect to the data base - $db = &DB::connect($config['dsn']); - if (DB::isError($db)) - die("Could not connect to the database"); - - // create logger - $conf['db'] = $db; - $logger = &Log::factory($config['log_handler'], 'log', $_SERVER['PHP_SELF'], $conf); - - // session handler - session_set_save_handler("open_session", "close_session", - "read_session", "write_session", "destroy_session", "gc_session"); - - // Show XML dump - if (!empty($_GET['dump']) && !empty($_GET['type'])) - { - $query = "SELECT " . ($_GET['type'] == 'identity' ? 'identity' : 'session') . - $query .= "_dump FROM users WHERE user_id=".$db->quoteSmart($_GET['dump']); - $res =& $db->query($query); - if (DB::isError($res)) - die($res->getMessage()); - - $row = $res->fetchRow(); -?> - - - - - - - - - - - -
Dump
- -
Close
- - -quoteSmart($_GET['del']); - $res =& $db->query($query); - if (DB::isError($res)) - die($res->getMessage()); - - $query = "DELETE FROM users WHERE user_id=".$db->quoteSmart($_GET['del']); - $res =& $db->query($query); - if (DB::isError($res)) - die($res->getMessage()); - - $logger->log("Delete User '".$_GET['del']."'", PEAR_LOG_NOTICE); - } - - lasso_init(); - - // Create Lasso Server - $server_dump = file_get_contents($config['server_dump_filename']); - $server = LassoServer::newFromDump($server_dump); - - // Lasso User - $login = new LassoLogin($server); - - // Count users - $query = "SELECT COUNT(*) FROM users"; - $res =& $db->query($query); - if (DB::isError($res)) - die($res->getMessage()); - - $row = $res->fetchRow(); - $count = $row[0]; - - - $startUser = ((empty($_GET['startUser'])) ? 0 : $_GET['startUser']); - - $query = "SELECT * FROM users"; - - if (!isset($_GET['show_all'])) - $query .= " OFFSET $startUser LIMIT " . ($startUser + $number_of_users); - $res =& $db->query($query); - - if (DB::isError($db)) - die($db->getMessage()); -?> - - - -Lasso Identity Provider Example : Users Management - - - - - -
- - -numCols(); - $tableinfo = $db->tableInfo($res); -?> - - - - - - - -" . $tableinfo[$i]['name'] .""; - } -?> - - - - -fetchRow()) { -?> - - - - - - - - - - - - - - - - - - -
Users
- - Previous"; - else - echo "Previous" - ?> - | - $number_of_users) && !isset($_GET['show_all'])) - echo "Next"; - else - echo "Next"; - - if (isset($_GET['show_all'])) - echo "| Paginate"; - else - { - for ($i = 0; $i < $count; $i += $number_of_users) - if ($i == $startUser) - echo "| " . ( $i / $number_of_users); - else - echo "| " . ( $i / $number_of_users) . ""; - if ($count > $number_of_users) - echo "| Show All"; - } - if ($count) - { - ?> - | Toggle All - - add user
  
- - - view"; - break; - case "session_dump": - $session_dump = $row[$i]; - if (empty($row[$i])) - echo " "; - else - echo "view"; - break; - default: - echo (empty($row[$i])) ? " " : $row[$i]; - } - ?> - - delete - edit -
- setIdentityFromDump($identity_dump); - $identity = $login->identity; - $providerIDs = $identity->providerIds; -?> - -length() ; $i++) - { -?> - - - - - -
getItem($i); ?>cancel federation
- -
 Total: Users
-
- -
-

Index -

- -
-

Copyright © 2004, 2005 Entr'ouvert

- - - - - -- cgit