source: contrib/Dms/op/op.EditUserData.php @ 3526

Revision 3526, 2.3 KB checked in by afernandes, 13 years ago (diff)

Ticket #1416 - Disponibilizado modulos Timesheet e DMS para a comunidade.

  • Property svn:executable set to *
Line 
1<?php
2include("../inc/inc.Settings.php");
3include("../inc/inc.AccessUtils.php");
4include("../inc/inc.ClassAccess.php");
5include("../inc/inc.ClassDocument.php");
6include("../inc/inc.ClassFolder.php");
7include("../inc/inc.ClassGroup.php");
8include("../inc/inc.ClassUser.php");
9include("../inc/inc.DBAccess.php");
10include("../inc/inc.FileUtils.php");
11include("../inc/inc.Language.php");
12include("../inc/inc.OutUtils.php");
13include("../inc/inc.Authentication.php");
14
15printHTMLHead( getMLText("my_account") );
16printTitleBar(getFolder($settings->_rootFolderID));
17printCenterStart();
18
19printStartBox(getMLText("my_account"));
20print "<div class=\"standardText\">";
21
22printMLText("editing_user_data");
23
24$fullname = sanitizeString($fullname);
25$email    = sanitizeString($email);
26$comment  = sanitizeString($comment);
27
28if (isset($pwd) && ($pwd != ""))
29        $user->setPwd(md5($pwd));
30
31if ($user->getFullName() != $fullname)
32        $user->setFullName($fullname);
33
34if ($user->getEmail() != $email)
35        $user->setEmail($email);
36
37if ($user->getComment() != $comment)
38        $user->setComment($comment);
39
40if (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
77printMLText("op_finished");
78printGoto(array(
79                        array(getMLText("content"), "../out/out.ViewFolder.php?folderid=1"),
80                        array(getMLText("my_account"), "../out/out.EditUserData.php")
81));
82
83print "</div>";
84printEndBox();
85printCenterEnd();
86printHTMLFoot();
87
88?>
Note: See TracBrowser for help on using the repository browser.