blob: 2562b9aeeb472dbe8b0a6fdee5ef58ab76e8a1a9 [file] [log] [blame]
<!--
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Registration</title>
<script type="text/javascript" src="../js/constants.js"></script>
<script type="text/javascript" src="../dojo/dojo.js"></script>
<script type="text/javascript">
dojo.addOnLoad(function() {
// dojo.require("dojo.rpc.JsonService");
dojo.require("dojo._base.xhr");
});
function populateInfo() {
dojo.xhrPost({
url:"../security", //photark.constants.SecurityEndpoint,
content:{userInfo:"get"},
handleAs: "text",
load: function(response, ioArgs){
setUserInfo(response);
},
error: function(response, ioArgs){
console.error("Error in getting user info");
}
});
}
function setUserInfo(response){
var array = new Array();
array =response.split(',');
document.getElementById('userId').innerHTML=""+array[1];
if(array[0]!=null && array[0]=="unRegistered"){
document.getElementById('realName').value=array[2];
document.getElementById('displayName').value=array[3];
document.getElementById('email').value=array[4];
document.getElementById('webSite').value=array[5];
}else {
}
}
function init() {
try {
populateInfo();
} catch (e) {
alert(e);
}
}
function redirect(){
window.location="../admin/upload.html";
}
function set(){
dojo.xhrPost({
url:"../security", //photark.constants.SecurityEndpoint,
content:{userInfo:"set",
realName:document.getElementById('realName').value,
displayName:document.getElementById('displayName').value,
email:document.getElementById('email').value,
webSite:document.getElementById('webSite').value},
handleAs: "text",
load: function(response, ioArgs){
redirect();
},
error: function(response, ioArgs){
console.error("Error in getting user info");
redirect();
}
});
}
</script>
</head>
<body onload="init()">
<h2>Get Registered With PhotArk</h2>
<table border="0">
<tr>
<td>OpenID : </td>
<td><div id="userId"></div></td>
</tr>
<tr>
<td>Real Name : </td>
<td><input id="realName" type="text" name="realName" /></td>
</tr>
<tr>
<td>Display Name : </td>
<td><input id="displayName" type="text" name="displayName" /></td>
</tr>
<tr>
<td>E-mail : </td>
<td><input id="email" type="text" name="email" /></td>
</tr>
<tr>
<td>Website :</td>
<td><input id="webSite" type="text" name="webSite" /></td>
</tr>
</tr>
<tr>
<td><button id="submit" type="button" onclick="set()">Register</button></td>
<td><button id="cancel" type="button" onclick="redirect()">Cancel</button></td>
</tr>
</table>
</body>
</html>