home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / admin / identities.inc < prev    next >
Encoding:
Text File  |  2003-03-16  |  1.1 KB  |  57 lines

  1. <?php
  2. /////////////////////////////////////////////////////////
  3. //    
  4. //    include/identities.inc
  5. //
  6. //    (C)Copyright 2000-2002 Ryo Chijiiwa <Ryo@IlohaMail.org>
  7. //
  8. //    This file is part of IlohaMail. IlohaMail is free software released 
  9. //    under the GPL license.  See enclosed file COPYING for details, or 
  10. //    see http://www.fsf.org/copyleft/gpl.html
  11. //
  12. /////////////////////////////////////////////////////////
  13.  
  14. class identity_obj{
  15.     var $name;
  16.     var $email;
  17.     var $replyto;
  18.     var $sig;
  19. }
  20.  
  21. function identities_parse($str){
  22.     $result = array();
  23.     $a = iil_ExplodeQuotedString(";", $str);
  24.     if (is_array($a)){
  25.         reset($a);
  26.         while( list($k, $v) = each($a) ){
  27.             $a2 = iil_ExplodeQuotedString(",", $v);
  28.             if (count($a2)==4){
  29.                 $temp = new identity_obj;
  30.                 $temp->name = $a2[0];
  31.                 $temp->email = $a2[1];
  32.                 $temp->replyto = $a2[2];
  33.                 $temp->sig = $a2[3];
  34.                 $result[] = $temp;
  35.             }
  36.         }
  37.     }else{
  38.         echo "Not array: ".$a."<br>";
  39.     }
  40.     
  41.     return $result;
  42. }
  43.  
  44. function identities_package($a){
  45.     $result = "";
  46.  
  47.     if (is_array($a)){
  48.         while ( list($k,$v)=each($a) ){
  49.             $result.=$v->name.",".$v->email.",".$v->replyto.",".$v->sig.";";
  50.         }
  51.     }
  52.     
  53.     return $result;
  54. }
  55.  
  56. ?>
  57.