[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/mydms/op/ -> op.EditUserData.php (source)

   1  <?php
   2  include ("../inc/inc.Settings.php");
   3  include ("../inc/inc.AccessUtils.php");
   4  include ("../inc/inc.ClassAccess.php");
   5  include ("../inc/inc.ClassDocument.php");
   6  include ("../inc/inc.ClassFolder.php");
   7  include ("../inc/inc.ClassGroup.php");
   8  include ("../inc/inc.ClassUser.php");
   9  include ("../inc/inc.DBAccess.php");
  10  include ("../inc/inc.FileUtils.php");
  11  include ("../inc/inc.Language.php");
  12  include ("../inc/inc.OutUtils.php");
  13  include ("../inc/inc.Authentication.php");
  14  
  15  printHTMLHead( getMLText("my_account") );
  16  printTitleBar(getFolder($settings->_rootFolderID));
  17  printCenterStart();
  18  
  19  printStartBox(getMLText("my_account"));
  20  print "<div class=\"standardText\">";
  21  
  22  printMLText("editing_user_data");
  23  
  24  $fullname = sanitizeString($fullname);
  25  $email    = sanitizeString($email);
  26  $comment  = sanitizeString($comment);
  27  
  28  if (isset($pwd) && ($pwd != ""))
  29      $user->setPwd(md5($pwd));
  30  
  31  if ($user->getFullName() != $fullname)
  32      $user->setFullName($fullname);
  33  
  34  if ($user->getEmail() != $email)
  35      $user->setEmail($email);
  36  
  37  if ($user->getComment() != $comment)
  38      $user->setComment($comment);
  39  
  40  if (isset($userfile) && ($userfile != "") && ($userfile != "none"))
  41  {
  42      $lastDotIndex = strrpos(basename($userfile_name), ".");
  43      $fileType = substr($userfile_name, $lastDotIndex);
  44      if ($fileType != ".jpg")
  45      {
  46          printMLText("error_occured");
  47          printMLText("only_jpg_user_images");
  48          printGoBack();
  49          print "</div>";
  50          printEndBox();
  51          printCenterEnd();
  52          printHTMLFoot();
  53          exit;
  54      }
  55      //verkleinern des Bildes, so dass es 150 Pixel hoch ist
  56      if(file_exists($userfile))
  57      {
  58          // Originalbild einlesen
  59          $origImg = imagecreatefromjpeg($userfile);
  60          $width = imagesx($origImg);
  61          $height = imagesy($origImg);
  62          // Thumbnail im Speicher erzeugen
  63          $newHeight = 150;
  64          $newWidth = ($width/$height) * $newHeight;
  65          $newImg = imagecreate($newWidth, $newHeight);
  66          // Verkleinern
  67          imagecopyresized($newImg, $origImg, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);
  68          // In File speichern 
  69          imagejpeg($newImg, $userfile);
  70          // Aufräumen
  71          imagedestroy($origImg);
  72          imagedestroy($newImg);
  73      }
  74      $user->setImage($userfile, $userfile_type);
  75  }
  76  
  77  printMLText("op_finished");
  78  printGoto(array(
  79              array(getMLText("content"), "../out/out.ViewFolder.php?folderid=1"),
  80              array(getMLText("my_account"), "../out/out.EditUserData.php")
  81  ));
  82  
  83  print "</div>";
  84  printEndBox();
  85  printCenterEnd();
  86  printHTMLFoot();
  87  
  88  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7