Subversion Repositories travelsized

Rev

Rev 456 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?PHP
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * This file is part of Travelsized CMS
 *              A content management system with modules, based on wiki syntax
 *
 * Author: Dan Jensen <admin@leinir.dk>
 * Copyright 2003/2004
 *
 * 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.
 *
 * The GNU General Public License is available at: http://www.gnu.org/copyleft/
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


        $page_title = i18n("Edit user: ##0##", array($viewUser));
        $tabwidget->tabbar->setCurrent(i18n("Edit"));
        if (!profileEditAllowed($viewUser))
        {
                $tabwidget->contents = i18n("You do not have the correct priviledges to edit this user");
                $page_content = $tabwidget->renderTabWidget();
        }
        else
        {
                if ( array_key_exists( "action", $_REQUEST ) && $_REQUEST["action"] == "avatarcrop")
                {
                        $image = getAvatar( $viewUser ); // the image to crop
                        $ext = checkImageMimetype( $image );
                        $dest_image = substr( $image, 0, strlen( $image ) - 4 ) . "-thumb" . substr( $image, -4 );
                       
                        /**
                         * Cropping method adopted from lixlpixel PHParadise
                         *
                         * category :           image editing
                         *
                         * snippet :            crop image
                         *
                         * downloaded : 11.02.2005 - 16:27
                         *
                         * file URL :           http://www.fundisom.com/phparadise/php/image_editing/crop_image
                         */

                       
                        $url = thisPageURL( false, true, array( "action" => "avatarcrop", "theme" => "empty") ); // the url to this wizard
                        $margin = 10; // to keep the image and layer in sync
                       
                        if(!isset($_POST['step'])) $title = '1';
                        else $title = $_POST['step'];
                       
                        $page_content = '
                        <html>
                        <head>
                                <title>'
. i18n("Cropping avatar - step ##0##", array($title)) . '</title>
                        </head>
                        <body style="margin: '
.$margin.'px;">';
                       
                        if(!isset($_POST['tx']) && !isset($_POST['fx']))
                        {
                                $page_content .= '
                                <form method="post" action="'
.$url.'">
                                        <input type="image" src="'
. siteURL(true) . $image .'"><p>';
                                if(!isset($_POST['x']))
                                {
                                        $page_content .= '
                                        <input type="hidden" name="step" value="2">
                                        '
. i18n("Click to mark the first corner of the selection rectangle.") . " " . i18n("You will be able to review the result before cropping");
                                }else{
                                        $page_content .= '
                                        <input type="hidden" name="step" value="3">
                                        <input type="hidden" name="fx" value="'
.$_POST['x'].'">
                                        <input type="hidden" name="fy" value="'
.$_POST['y'].'">
                                        '
. i18n("Click to mark the second corner of the selection rectangle.") . ' | <a href="'.$url.'">' . i18n("Start over") . '</a> ' . " " . i18n("You will be able to review the result before cropping");
                                }
                                $page_content .= '
                                </form>
                                '
;
                        }
                       
                        if(isset($_POST['fx']))
                        {
                                $page_content .= '
                                <form method="post" action="'
.$url.'">
                                        <input type="hidden" name="step" value="4">
                                        <input type="image" src="'
. siteURL(true) . $image .'">
                                        <input type="hidden" name="tx" value="'
.$_POST['fx'].'">
                                        <input type="hidden" name="ty" value="'
.$_POST['fy'].'">
                                        <input type="hidden" name="width" value="'
.($_POST['x']-$_POST['fx']).'">
                                        <input type="hidden" name="height" value="'
.($_POST['y']-$_POST['fy']).'"><p>
                                        <div style="position: absolute;
                                                                left:'
.($_POST['fx']+$margin).'px;
                                                                top: '
.($_POST['fy']+$margin).'px;
                                                                width: '
.($_POST['x']-$_POST['fx']).'px;
                                                                height: '
.($_POST['y']-$_POST['fy']).'px;
                                                                border: 1px solid #fff;">
                                        </div>
                                        '
. i18n("Click the image to crop. The rectangle shown on the picture is the rectangle that will be cropped.") . '| <a href="'.$url.'">' . i18n("Start over") . '</a>
                                </form>'
;
                        }
                       
                        if(isset($_POST['tx']))
                        {
                                // Crop the image
                                cropImage( $image, $dest_image, $_POST["tx"], $_POST["ty"], $_POST["width"], $_POST["height"] );
                               
                                // Resize the new thumbnail to the max thumbnail size
                                scaleImage( $dest_image, $dest_image, $profile_options["thumbnail_width"], $profile_options["thumbnail_height"] );
                               
                                // make sure the file is actually accessible...
                                chmod($dest_image, 0664);
                               
                                header("Location: " . globalIDtoURL("user/$viewUser/edit/user_avatar"));
                        }
                }
                else
                {
                        $userinfo = array();
                        if( array_key_exists( "save_profileinfo", $_REQUEST ) )
                        {
                                if( array_key_exists( "profiles_hideme", $_REQUEST ) )
                                        saveUserInfo( $viewUser, "profiles_hideme", 1 );
                                else
                                        saveUserInfo( $viewUser, "profiles_hideme", 0 );
                        }
                        if( array_key_exists( "profiles_view", $_REQUEST ) )
                                saveUserInfo($viewUser, "profiles_view", $_REQUEST["profiles_view"]);
                        if( array_key_exists( "profiles_contact", $_REQUEST ) )
                                saveUserInfo($viewUser, "profiles_contact", $_REQUEST["profiles_contact"]);
                        if( array_key_exists( "profiles_mypage", $_REQUEST ) )
                                saveUserInfo($viewUser, "profiles_mypage", $_REQUEST["profiles_mypage"]);
                       
                        if( array_key_exists( "new_profile", $_REQUEST ) )
                                saveUserInfo($viewUser, "profile", stripslashes($_REQUEST["new_profile"]));
                        if( array_key_exists( "new_realname", $_REQUEST ) )
                                saveUserInfo($viewUser, "name", stripslashes($_REQUEST["new_realname"]));
                        if( array_key_exists( "new_signature", $_REQUEST ) )
                                saveUserInfo( $viewUser, "signature", stripslashes($_REQUEST["new_signature"]) );
                       
                        $email_errormessage = "";
                        if( array_key_exists( "new_email", $_REQUEST ) && validateEmail(stripslashes($_REQUEST["new_email"])) )
                                saveUserInfo($viewUser, "email", stripslashes($_REQUEST["new_email"]));
                        else if( array_key_exists( "new_email", $_REQUEST ) && !validateEmail(stripslashes($_REQUEST["new_email"])) )
                                $email_errormessage = i18n("Your email address is not valid");
                       
                        $userinfo["profiles_hideme"] = getUserInfo($viewUser, "profiles_hideme");
                        $userinfo["profiles_view"] = getUserInfo($viewUser, "profiles_view");
                        if ($userinfo["profiles_view"] == i18n("No ##0## information\n", array("profiles_view"))) $userinfo["profiles_view"] = $profile_options["profiles_view"];
                        $userinfo["profiles_contact"] = getUserInfo($viewUser, "profiles_contact");
                        if ($userinfo["profiles_contact"] == i18n("No ##0## information\n", array("profiles_contact"))) $userinfo["profiles_contact"] = $profile_options["profiles_contact"];
                        $userinfo["profiles_mypage"] = getUserInfo($viewUser, "profiles_mypage");
                        if ($userinfo["profiles_mypage"] == i18n("No ##0## information\n", array("profiles_mypage"))) $userinfo["profiles_mypage"] = $profile_options["profiles_mypage"];
                        $userinfo["profile"] = getUserInfo($viewUser, "profile");
                        $userinfo["contactinfo"] = unserialize(getUserInfo($viewUser, "contactinfo"));
                        $userinfo["name"] = getUserInfo($viewUser, "name");
                        $userinfo["email"] = getUserInfo($viewUser, "email");
                        $userinfo["signature"] = getUserInfo($viewUser, "signature", "" );
                       
                        $contact_errormessage = array();
                        if( array_key_exists( "contact", $_REQUEST ) && is_array($_REQUEST["contact"]) )
                        {
                                foreach ($_REQUEST["contact"] as $key => $value) {
                                        if (eregi($profile_options["contact_fields"][$key]["regexp"], stripslashes($value)) || $value == "")
                                                $userinfo["contactinfo"][$key] = stripslashes($value);
                                        else
                                                $contact_errormessage[$key] = i18n("The entered contact information is not valid!");
                                }
                                saveUserInfo($viewUser, "contactinfo", serialize($userinfo["contactinfo"]));
                        }
                       
                        $password_errormessage = "";
                        if( array_key_exists( "new_password", $_REQUEST ) && array_key_exists( "new_password2", $_REQUEST ) )
                        {
                                if ($_REQUEST["new_password"] == $_REQUEST["new_password2"])
                                        $usermanager->changeadd($viewUser, $_REQUEST["new_password"]);
                                else
                                        $password_errormessage = i18n("The two password must match!");
                        }
                       
                        if( array_key_exists( "avatardelete", $_REQUEST ) )
                                unlink_multiple("$userinfo_folder/$viewUser/avatar*");
                       
                        if ((array_key_exists( "uploadedfile", $_FILES) && is_array($_FILES["uploadedfile"]) && $_REQUEST["upload_avatar"]) || ( array_key_exists( "action", $_REQUEST ) && $_REQUEST["action"] == "avatarresize" ) )
                        {
                                $errorHandler = new errorHandler( thisPageURL() );
                                if ($_REQUEST["action"] == "avatarresize") {
                                        $uploadFile = getAvatar( $viewUser ); // the image to crop
                                        $ext = checkImageMimetype( $uploadFile );
                                        $thumbAvatar = substr( $uploadFile, 0, strlen( $uploadFile ) ) . "-thumb" . $ext;
                                        if (file_exists($thumbAvatar))
                                                unlink($thumbAvatar);
                                        $continue = true;
                                } else {
                                        unlink_multiple("$userinfo_folder/$viewUser/avatar*"); // delete the old avatar
                                       
                                        if ( checkImageMimetype( $_FILES['uploadedfile']['tmp_name'], $_FILES['uploadedfile']['name'] ) === false )
                                        {
                                                $continue = false;
                                                $upload_wrongfilesuffix = true;
                                        }
                                        else
                                        {
                                                $uploadFile = "$userinfo_folder/$viewUser/avatar." . checkImageMimetype( $_FILES['uploadedfile']['tmp_name'], $_FILES['uploadedfile']['name'] );
                                                $thumbAvatar = "$userinfo_folder/$viewUser/avatar-thumb." . checkImageMimetype( $_FILES['uploadedfile']['tmp_name'], $_FILES['uploadedfile']['name'] );
                                                $continue = move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $uploadFile);
                                        }
                                }
                                if ($continue) {
                                        $errorHandler->handle( i18n( "Resizing ##0##", array( $filename ) ), scaleImage( $uploadFile, $uploadFile, $profile_options["avatar_maxwidth"], $profile_options["avatar_maxheight"] ) );
                                        if( !$profile_options['thumbnail_disable'] )
                                                $errorHandler->handle( i18n( "Thumbnailing ##0##", array( $filename ) ), scaleImage( $uploadFile, $thumbAvatar, $profile_options["thumbnail_width"], $profile_options["thumbnail_height"] ) );
                                       
                                        chmod($uploadFile, 0664);// make sure the file is actually accessible...
                                        if( file_exists( $thumbAvatar ) )
                                                chmod($thumbAvatar, 0664);// make sure the file is actually accessible...
                                       
                                        header("Location: " . globalIDtoURL("user/$viewUser/edit/user_avatar") );
                                } else {
                                        if ($upload_wrongfilesuffix) {
                                                $errorHandler->handle(
                                                        i18n("Error during avatar upload"),
                                                        i18n("The file is in an unknown format. The following formats are supported") . ":
                                                         png (Portable Network Graphics)
                                                        , jpg, jpeg (Joint Pictures Expert Group)
                                                        , gif (Graphics Interchange Format)"
);
                                        } else {
                                                switch ($_FILES['uploadedfile']['error']) {
                                                case 1:
                                                        $theError = "The uploaded file exceeds the upload_max_filesize directive in php.ini. Please contact your host and rectify this (or better yet, select a smaller file. Most often, this directive states 2MB as the maximum upload size, however as we have 1MB as the maxium here, they have obviously changed it).";
                                                        break;
                                                case 2:
                                                        $theError = "The uploaded file exceeds 1MB in size, and is too large to upload in this manner.";
                                                        break;
                                                case 3:
                                                        $theError = "The uploaded file was only partially uploaded.";
                                                        break;
                                                case 4:
                                                        $theError = "No file was uploaded.";
                                                        break;
                                                }
                                                $errorHandler->handle(
                                                        i18n("The following error occurred during upload of your avatar"),
                                                        $theError);
                                        }
                                        $tabwidget->contents = $errorHandler->render();
                                }
                        }
                       
                        if( count( $contact_errormessage ) < 1 && array_key_exists( "save_profileinfo", $_POST ) )
                                $tabwidget->contents .= renderInformationBox( i18n("Success"), i18n("The profile information was saved successfully") );
                       
                       
                        $avatarfile = getAvatar( $viewUser );
                        $avatarthumbfile = getAvatarThumbnail( $viewUser );
                        list($avatarwidth,$avatarheight) = getimagesize($avatarthumbfile);
                        $avatarfile = siteURL(true) . $avatarfile;
                        $avatarthumbfile = siteURL(true) . $avatarthumbfile;
                       
                        global $permissionlevels_array;
                        $permissionlevels_view = $permissionlevels_contact = $permissionlevels_mypage = "";
                        foreach($permissionlevels_array as $key => $value) {
                                if ($userinfo["profiles_view"] == $key) { $default = " selected"; } else { $default = ""; }
                                $permissionlevels_view .= "<option value=\"$key\"$default>$value</option>";
                                if ($userinfo["profiles_contact"] == $key) { $default = " selected"; } else { $default = ""; }
                                $permissionlevels_contact .= "<option value=\"$key\"$default>$value</option>";
                                if ($userinfo["profiles_mypage"] == $key) { $default = " selected"; } else { $default = ""; }
                                $permissionlevels_mypage .= "<option value=\"$key\"$default>$value</option>";
                        }
                       
                        $edit_section["general_information"] = ( $_REQUEST["edit_section"] == "" ) ? "on" : "off";
                        $edit_section["view_options"] = "off";
                        $edit_section["contact_information"] = "off";
                        $edit_section["user_avatar"] = "off";
                        $edit_section["profile"] = "off";
                       
                        $edit_section[ $_REQUEST["edit_section"] ] = "on";
                       
                        foreach( $edit_section as $key => $value )
                        {
                                if( $value == "on" )
                                {
                                        $edit_section[$key] = "<img style=\"vertical-align: middle;\" border=\"0\" src=\"" . siteURL(true) . "$setup_folder/images/selection-on.png\" width=\"10\" height=\"10\" alt=\"x\" /><strong>";
                                        $edit_sectionend[$key] = "</strong>";
                                }
                                else
                                {
                                        $edit_section[$key] = "<img style=\"vertical-align: middle;\" border=\"0\" src=\"" . siteURL(true) . "$setup_folder/images/selection-off.png\" width=\"10\" height=\"10\" alt=\"o\" />";
                                        $edit_sectionend[$key] = "";
                                }
                        }
                       
                        $tabwidget->addCommand( i18n("##0## General information##1##", array($edit_section["general_information"], $edit_sectionend["general_information"]) ), i18n("General information"), globalIDtoURL("user/$viewUser/edit") );
                        $tabwidget->addCommand( i18n("##0## Profile##1##", array($edit_section["profile"], $edit_sectionend["profile"]) ), i18n("Profile"), globalIDtoURL("user/$viewUser/edit/profile") );
                        $tabwidget->addCommand( i18n("##0## User avatar##1##", array($edit_section["user_avatar"], $edit_sectionend["user_avatar"]) ), i18n("User avatar"), globalIDtoURL("user/$viewUser/edit/user_avatar") );
                        $tabwidget->addCommand( i18n("##0## Contact information##1##", array($edit_section["contact_information"], $edit_sectionend["contact_information"]) ), i18n("Contact information"), globalIDtoURL("user/$viewUser/edit/contact_information") );
                        $tabwidget->addCommand( i18n("##0## View options##1##", array($edit_section["view_options"], $edit_sectionend["view_options"]) ), i18n("View options"), globalIDtoURL("user/$viewUser/edit/view_options") );

                        $tabwidget->contents .= "
                        <form enctype=\"multipart/form-data\" action=\""
. globalIDtoURL("user/$viewUser/edit/{$_REQUEST['edit_section']}") . "\" method=\"post\">
                        <table class=\"setup\">"
;
                       
                        switch( $_REQUEST["edit_section"] )
                        {
                        case "view_options":
                                $hideme = "";
                                if($userinfo["profiles_hideme"] == 1)
                                        $hideme .= "checked";
                                $tabwidget->contents .= "
                                <tr class=\"setup\">
                                        <td class=\"setup\" width=\"50%\">"
. i18n("##0##'s profile is hidden from userlists", array( getUserInfo( $viewUser, "name" ) ) ) . "</td>
                                        <td class=\"setup\" width=\"50%\"><label><input type=\"checkbox\" name=\"profiles_hideme\" $hideme/>"
. i18n( "Hide ##0## in userlists", array( getUserInfo( $viewUser, "name" ) ) ) . "</label></td>
                                </tr>
                                <tr class=\"setup\">
                                        <td class=\"setup\" width=\"50%\">"
. i18n("##0##'s profile is viewable by", array( getUserInfo( $viewUser, "name" ) ) ) . "</td>
                                        <td class=\"setup\" width=\"50%\"><select style=\"width: 100%;\" name=\"profiles_view\">$permissionlevels_view</select></td>
                                </tr>
                                <tr class=\"setup\">
                                        <td class=\"setup\">"
. i18n("##0## can be contacted by", array( getUserInfo( $viewUser, "name" ) ) ) . "</td>
                                        <td class=\"setup\"><select style=\"width: 100%;\" name=\"profiles_contact\">$permissionlevels_contact</select></td>
                                </tr>
                                <tr class=\"setup\">
                                        <td class=\"setup\">"
. i18n("##0##'s personal page can be viewed by", array( getUserInfo( $viewUser, "name" ) ) ) . "</td>
                                        <td class=\"setup\"><select style=\"width: 100%;\" name=\"profiles_mypage\">$permissionlevels_mypage</select></td>
                                </tr>"
;
                                break;
                        case "contact_information":
                                $tabwidget->contents .= "
                                <tr class=\"setup\">
                                        <td width=\"50%\" class=\"setup\">
                                                "
. i18n("Email address") . ":<span class=\"error\">$email_errormessage</span><br />
                                                <small class=\"comment\">"
. i18n("The email address you wish to use, for example johndoe@site.com") . "</small>
                                        </td>
                                        <td width=\"50%\" class=\"setup\">
                                                <input style=\"width: 100%\" type=\"text\" name=\"new_email\" value=\"{$userinfo['email']}\" />
                                        </td>
                                </tr>"
;
                                if( is_array( $profile_options["contact_fields"] ) )
                                {
                                        foreach ($profile_options["contact_fields"] as $key => $value) {
                                                $theError = "";
                                                if( array_key_exists( $key, $contact_errormessage  ) )
                                                        $theError = $contact_errormessage[$key];
                                                $tabwidget->contents .= "
                                                <tr class=\"setup\">
                                                        <td class=\"setup\">
                                                                "
. i18n("$key") . ":<span class=\"error\">" . $theError . "</span><br />
                                                                <small class=\"comment\">"
. i18n($value["description"]) . "</small>
                                                        </td>
                                                        <td class=\"setup\">
                                                                <input style=\"width: 100%\" type=\"text\" name=\"contact[$key]\" value=\""
. $userinfo['contactinfo'][$key] . "\" />
                                                        </td>
                                                </tr>"
;
                                        }
                                }
                                break;
                        case "user_avatar":
                                $tabwidget->contents .= "
                                <tr class=\"setup\">
                                        <td width=\"50%\" class=\"setup\">
                                                "
. i18n("User avatar") . ":<br />
                                                <small class=\"comment\">"
. i18n("The user avatar can be a maximum width of ##0## pixels and a maximum height of ##1##", array($profile_options['avatar_maxwidth'], $profile_options['avatar_maxheight'])) . "</small><br />
                                                "
. i18n("Upload avatar") . ":<br />
                                                <small class=\"comment\">"
. i18n("Select a file for uploading as your avatar. This must be one of either jpg, gif or png format, and be of smaller filesize than ##0##. The image will be resized as required.", array(ini_get("upload_max_filesize"))) .  "</small>
                                                <input style=\"width: 100%\" type=\"file\" name=\"uploadedfile\" />
                                        </td>
                                        <td width=\"50%\" class=\"setup\">
                                                <div align=\"center\">
                                                        <a style=\"border: none;\" href=\"$avatarfile\" target=\"_blank\"><img border=\"0\" src=\"$avatarthumbfile?x="
. (uniqid((double)microtime()*1000000,1)) . "\" width=\"$avatarwidth\" height=\"$avatarheight\" alt=\"" . i18n("##0##'s avatar", array($userinfo['name'])) . "\" /></a><br />
                                                        </div>
                                        </td>
                                </tr>
                                <tr class=\"setup\">
                                        <td width=\"50%\" class=\"setup\">
                                                <div align=\"center\">
                                                        <input type=\"submit\" name=\"upload_avatar\" value=\""
. i18n("Upload the avatar") . "\" />
                                                </div>
                                        </td>
                                        <td width=\"50%\" class=\"setup\">
                                                <div align=\"center\">
                                                        <input type=\"submit\" name=\"avatardelete\" value=\""
. i18n("Delete the avatar") . "\" />
                                                </div>
                                        </td>
                                </tr>"
;
                       
                                if( !$profile_options["thumbnail_disable"] )
                                        $tabwidget->contents .= "
                                        <tr class=\"setup\">
                                                <td class=\"setup\">
                                                        "
. i18n("Select avatar thumbnail") . ":<br />
                                                        <small class=\"comment\">"
. i18n("You can select two types of thumbnail for your avatar, either you select the full size picture and scale it down to the thumbnail size (the default), or you can crop your way to the section of the image you wish to use as the thumbnail (if this cropped section is larger than the allowed thumbnail size, it will then be scaled down accordingly)") . "</small>
                                                </td>
                                                <td class=\"setup\">
                                                        <div class=\"wikicenteralign\">
                                                                <a class=\"command\" href=\""
. thisPageURL( false, true, array( "action" => "avatarresize", "edit_section" => "user_avatar" ) ) . "\">[" . i18n("Resize full size picture") . "]</a>
                                                                <br /><br />
                                                                <a class=\"command\" href=\""
. thisPageURL( false, true, array( "action" => "avatarcrop", "theme" => "empty", "edit_section" => "user_avatar" ) ) . "\">[" . i18n("Crop and Resize") . "]</a>
                                                        </div>
                                                </td>
                                        </tr>"
;
                                break;
                        case "profile":
                                $tabwidget->contents .= "
                                $formatting_toolbar
                                <tr class=\"setup\">
                                        <td class=\"setup\" colspan=\"2\">
                                                <textarea rows=\"15\" cols=\"70\" style=\"width: 100%;\" id=\"edit\" name=\"new_profile\">{$userinfo['profile']}</textarea>
                                                "
. generate_pagehelplink() . "
                                        </td>
                                </tr>"
;
                                break;
                        default:
                                $new_password = $new_password2 = "";
                                if( array_key_exists("new_password", $_REQUEST) )
                                        $new_password = $_REQUEST['new_password'];
                                if( array_key_exists("new_password2", $_REQUEST) )
                                        $new_password2 = $_REQUEST['new_password2'];
                                $tabwidget->contents .= "
                                <tr class=\"setup\">
                                        <td class=\"setup\" width=\"50%\">
                                                        "
. i18n("Username") . ":<br />
                                                        <small class=\"comment\">"
. i18n("If you wish to change your username, please contact ##0##the site administrator##1##", array("<a href=\"" . globalIDtoURL("user/admin/contact") . "\">", "</a>")) . "</small>
                                                </th>
                                        <td class=\"setup\">"
. $viewUser . "</th>
                                </tr>
                                <tr class=\"setup\">
                                        <td class=\"setup\">
                                                "
. i18n("Password") . ":<span class=\"error\">$password_errormessage</span><br />
                                                <small class=\"comment\">"
. i18n("You only need to type in a password if you wish to change your existing one. A password, at least 8 characters long. Repeat the password in the two boxes. Preferably comprised of a mix of upper and lower case characters and numbers, for example ##0##", array(makeRandomPassword())) . "</small>
                                        </td>
                                        <td class=\"setup\">
                                                <input style=\"width: 100%\" type=\"password\" name=\"new_password\" value=\"$new_password\" />
                                                <input style=\"width: 100%\" type=\"password\" name=\"new_password2\" value=\"$new_password2\" />
                                        </td>
                                </tr>
                                <tr class=\"setup\">
                                        <td class=\"setup\">
                                                "
. i18n("Full name") . ":<br />
                                                <small class=\"comment\">"
. i18n("Your full name, for example John Doe") . "</small>
                                        </td>
                                        <td class=\"setup\">
                                                <input style=\"width: 100%\" type=\"text\" name=\"new_realname\" value=\"{$userinfo['name']}\" />
                                        </td>
                                </tr>
                                <tr class=\"setup\">
                                        <td class=\"setup\">
                                                "
. i18n("Signature") . ":<br />
                                                <small class=\"comment\">"
. i18n("The signature you wish to use for when you create comments") . "</small>
                                        </td>
                                        <td class=\"setup\">
                                                <textarea rows=\"3\" cols=\"70\" style=\"width: 100%\" name=\"new_signature\">{$userinfo['signature']}</textarea>
                                        </td>
                                </tr>"
;
                        }
                       
                        $tabwidget->contents .= ( $_REQUEST["edit_section"] == "user_avatar" ) ? "
                        </table>
                        </form>"
: "
                        <tr class=\"setup\">
                                <td class=\"setup\"><input type=\"submit\" name=\"save_profileinfo\" value=\""
. i18n("Save details") . "\" /></td>
                                <td  class=\"setup wikirightalign\"><input type=\"reset\" value=\""
. i18n("Reset") . "\" /></td>
                        </tr>
                        </table>
                        </form>
                        "
;
                        $page_content = $tabwidget->renderTabWidget();
                }
        }
?>