scripts/user_data.php

Go to the documentation of this file.
00001 <?php
00002   /*
00003    This file is part of DocBookWiki.  DocBookWiki is a web application
00004    that displays and edits DocBook documents.
00005 
00006    Copyright (C) 2004, 2005, 2006, 2007
00007    Dashamir Hoxha, dashohoxha@users.sourceforge.net
00008 
00009    DocBookWiki is free software; you can redistribute it and/or modify
00010    it under the  terms of the GNU General  Public License as published
00011    by the Free  Software Foundation; either version 2  of the License,
00012    or (at your option) any later version.
00013 
00014    DocBookWiki is distributed in the  hope that it will be useful, but
00015    WITHOUT  ANY  WARRANTY;  without   even  the  implied  warranty  of
00016    MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU
00017    General Public License for more details.
00018 
00019    You should have  received a copy of the  GNU General Public License
00020    along  with  DocBookWiki;  if  not,  write  to  the  Free  Software
00021    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022    USA
00023   */
00024 
00029 function get_user_data($username)
00030 {
00031   $user_record = shell(SCRIPTS."users/get_user.sh $username");
00032   if (trim($user_record)=='')  $user_record = "::::";
00033   $arr = explode(':', chop($user_record));
00034   $user_data = array(
00035                      'username' => $arr[0],
00036                      'password' => $arr[1],
00037                      'name'     => $arr[2],
00038                      'email'    => $arr[3],
00039                      'books'    => $arr[4]
00040                      );
00041   return $user_data;
00042 }
00043 
00044 function save_user_data($user_data)
00045 {
00046   $username = $user_data['username'];
00047   $user_record = implode(':', $user_data);
00048   shell(SCRIPTS."users/del_user.sh $username");
00049   shell(SCRIPTS."users/add_user.sh '$user_record'");
00050 }
00051 ?>

Generated on Wed Jan 9 08:27:32 2008 for DokBookWiki by  doxygen 1.5.2