<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ChangeDetails.aspx.cs" Inherits="edu.jhu.Cas.Web.ChangeDetails" %>
<%@ Register TagPrefix="uc1" TagName="Trailer" Src="Trailer.ascx" %>
<%@ Register TagPrefix="uc2" TagName="Header" Src="top.ascx" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="edu.jhu.Cas.Users" %>
<%@ Import Namespace="edu.jhu.Cas.Util" %>
<%@ Import Namespace="edu.jhu.Cas.Web" %>
<%@ Import Namespace="System.IO" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Change Details</title>
    <link href="cjobs.css" rel="stylesheet" />
</head>
<body>
    <uc2:Header ID="Header" runat="server" />

        <div style="margin:5 0 5 0;padding:0 5 0 5;" class="message"><%=lmessage%></div>



        <form name="updateAccount" action="ChangeDetails.aspx" method="post" runat="server">
        <table class="uform">
            <tr>
                <th class="bx">
                    WSID</th>
                <td>
                    <%=wsid%>
                </td>
            </tr>
            <tr>
                <th class="bx">
                    Userid</th>
                <td>
                    <input type="text" name="userid" value="<%=user == null ? Request.Params["userid"] : user.UserID%>"
                        size="32" />
                </td>
                <% if (Request.Params["userid"] != null && Request.Params["userid"].Length == 0) {%>
                <td>
                    <p>
                        Please enter a userid
                    </p>
                </td>
                <%}%>
            </tr>
            <tr>
                <th class="bx">
                    Full Name</th>
                <td>
                    <input type="text" name="name" value="<%=user == null ? Request.Params["name"] : user.Name%> "
                        size="50" />
                </td>
                <% if (Request.Params["name"] != null && Request.Params["name"].Length == 0) {%>
                <td>
                    <p>
                        Please enter your name
                    </p>
                </td>
                <%}%>
            </tr>
            <tr>
                <th class="bx">
                    Email Address</th>
                <td>
                    <input type="text" name="email" value="<%=user == null ? Request.Params["email"] : user.Email%>"
                        size="50" />
                </td>
                <% if (Request.Params["email"] != null && Request.Params["email"].Length == 0) {%>
                <td>
                    <p>
                        Please enter your Email address
                    </p>
                </td>
                <%}%>
            </tr>
            <tr>
                <th class="bx">
                    Level of Emails</th>
                <td>
                    <% int el = user == null ? Convert.ToInt32(Request.Params["emaillevel"]) : user.EmailLevel;%>
                    <select name="emaillevel">
                        <option value="0" <%= (el == EMAIL.ADMIN_ONLY) ? "selected=t" : "" %>>Admin Only </option>
		                <option value="1" <%= (el == EMAIL.ON_BATCH_FAILURE) ? "selected=t" : "" %>>On Failures </option>
		                <option value="2" <%= (el == EMAIL.ON_BATCH_COMPLETION) ? "selected=t" : "" %>>On Completion </option>
		                <option value="3" <%= (el == EMAIL.ON_BATCH_FAILURE_OR_COMPLETION) ? "selected=t" : "" %>>On Fail or Complete</option>
                    </select>
                </td>
            </tr>
            <tr>
                <th class="bx">
                    New Password</th>
                <td>
                    <input name="newpassword" type="password" value="" size="20" />
                </td>
                <td>
                    <p>
                        <%=pmessage%>
                    </p>
                </td>
            </tr>
            <tr>
                <th class="bx">
                    Confirm New Password</th>
                <td>
                    <input name="confirmpassword" value="" type="password" size="20" />
                </td>
            </tr>
            <tr>
                <th class="bx">
                    Group Visibility</th>
                <td colspan="2">
                    <% bool checkgv = (Request.Params["gvisible"] != null || (user != null && user.GVisible));%>
                    <input name="gvisible" type="CheckBox" <%=checkgv?"checked":" "%> />
                    <%if (checkgv) {%>
                    Uncheck this if you do not wish
                    <%}
  else {%>
                    Check this to have
                    <%}%>
                    your name to appear in the Group Member Selection list of other users.
                </td>
            </tr>
            <% if (ConfigurationManager.AppSettings["OpenID"] == "true")
               { %>
            <tr>
                <th class="bx">
                    OpenID
                </th>
                <td>
                    <textarea name="openid" cols="60" rows="10" style="white-space: nowrap;"><%
                   if (user != null)
                   {
                       foreach (string s in user.OpenID)
                       {
                           Response.Write(s + "\n");
                       }
                   }
                   if (returnedOpenID != null)
                   {
                       Response.Write(returnedOpenID);
                   }
                        %></textarea>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:ImageButton ID="LoginGoogle" ImageUrl="img/google_32.png" OnClick="LoginButton_Click" CommandName="LoginGoogle" runat="server"></asp:ImageButton>
                    <asp:ImageButton ID="LoginYahoo" ImageUrl="img/yahoo_32.png" OnClick="LoginButton_Click" CommandName="LoginYahoo" runat="server"></asp:ImageButton>
                    <asp:ImageButton ID="LoginVAO" ImageUrl="img/VAO_logo_100.png" OnClick="LoginButton_Click" CommandName="LoginVAO" runat="server"></asp:ImageButton>
                </td>
            </tr>
            <% } %>
            <tr>
                <td>
                </td>
                <td>
                    <p />
                    <input type="submit" value="Update Account" />
                    </td>
            </tr>
        </table>
    </form>
    <uc1:Trailer ID="Trailer1" runat="server" cvsTag="$Name$" cvsRev="$Revision: 145898 $">
    </uc1:Trailer>
</body>
</html>
