aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Carlson <thecarlsondaddy@gmail.com>2016-11-03 14:10:27 -0400
committerAndy Carlson <thecarlsondaddy@gmail.com>2016-11-03 14:10:27 -0400
commita70e64268e4c5b6ce5ca18ed3c80631e607f6994 (patch)
treed01ef08ea0ffabaf1e0f543c94bc1b3c26c745c3
parent0f4e6d69a1e7990860ae410a78383d7343b85799 (diff)
rename files/resourceType
-rw-r--r--modrepo.sh16
-rw-r--r--useredit.html40
-rw-r--r--usermgr.html50
3 files changed, 98 insertions, 8 deletions
diff --git a/modrepo.sh b/modrepo.sh
index 0e31248..b6c5cd7 100644
--- a/modrepo.sh
+++ b/modrepo.sh
@@ -8,32 +8,32 @@ curl -s -u $slinguser:$slingpass -X MKCOL $proto://$hostport/apps/users > /dev/n
printf "done\n"
printf "Creating /apps/users/password..."
-curl -s -u $slinguser:$slingpass -X MKCOL $proto://$hostport/apps/users/password > /dev/null
+curl -s -u $slinguser:$slingpass -X MKCOL $proto://$hostport/apps/users/edit > /dev/null
printf "done\n"
printf "Creating /apps/users/create..."
-curl -s -u $slinguser:$slingpass -X MKCOL $proto://$hostport/apps/users/create > /dev/null
+curl -s -u $slinguser:$slingpass -X MKCOL $proto://$hostport/apps/users/manage > /dev/null
printf "done\n"
-printf "Creating /content/newuser..."
+printf "Creating /content/usermgr..."
curl -s -u $slinguser:$slingpass -X MKCOL $proto://$hostport/content/newuser > /dev/null
printf "done\n"
printf "Uploading /apps/users/password HTML..."
-curl -s -u $slinguser:$slingpass -T password.html $proto://$hostport/apps/users/password/html.esp > /dev/null
+curl -s -u $slinguser:$slingpass -T useredit.html $proto://$hostport/apps/users/edit/html.esp > /dev/null
printf "done\n"
printf "Uploading /apps/users/create HTML..."
-curl -s -u $slinguser:$slingpass -T create.html $proto://$hostport/apps/users/create/html.esp > /dev/null
+curl -s -u $slinguser:$slingpass -T usermgr.html $proto://$hostport/apps/users/manage/html.esp > /dev/null
printf "done\n"
-printf "Setting attributes for /content/newuser..."
-curl -s -u $slinguser:$slingpass -F"sling:resourceType=users/create" $proto://$hostport/content/newuser > /dev/null
+printf "Setting attributes for /content/usermgr..."
+curl -s -u $slinguser:$slingpass -F"sling:resourceType=users/manage" $proto://$hostport/content/usermgr > /dev/null
printf "done\n"
cat userlist.txt | while read user; do
printf "Setting attributes for /home/users/${user:0:1}/${user}..."
- curl -s -u $slinguser:$slingpass -F"sling:resourceType=users/password" $proto://$hostport/home/users/${user:0:1}/$user.html > /dev/null
+ curl -s -u $slinguser:$slingpass -F"sling:resourceType=users/edit" $proto://$hostport/home/users/${user:0:1}/$user.html > /dev/null
curl -s -u $slinguser:$slingpass -F"uid=$user" $proto://$hostport/home/users/${user:0:1}/$user.html > /dev/null
printf "done\n"
done
diff --git a/useredit.html b/useredit.html
new file mode 100644
index 0000000..e7d169f
--- /dev/null
+++ b/useredit.html
@@ -0,0 +1,40 @@
+<html>
+<head>
+<title>UserManager-<%= currentNode.uid %></title>
+</head>
+<script type="text/javascript">
+ function getJSON(url) {
+ var resp ;
+ var xmlHttp ;
+
+ resp = '' ;
+ xmlHttp = new XMLHttpRequest();
+
+ if(xmlHttp != null)
+ {
+ xmlHttp.open( "GET", url, false );
+ xmlHttp.send( null );
+ resp = xmlHttp.responseText;
+ }
+
+ return resp ;
+ }
+
+ function loadUserInfo() {
+ var jsontext = getJSON("<%= currentNode.uid %>.json");
+ document.getElementById('userjson').innerHTML = jsontext.replace(/}$/,'\n}').replace(/^{/,'{\n').replace(/,/g,',\n');
+ }
+</script>
+<body onLoad="loadUserInfo();">
+<h3>Change Password for <%= currentNode.uid %></h3>
+<form method="POST" action="/system/userManager/user/<%= currentNode.uid %>.changePassword.html">
+Old Password:<input type="password" name="oldPwd" /><br/>
+New Password:<input type="password" name="newPwd" /><br/>
+Confirm New:<input type="password" name="newPwdConfirm" /><br/>
+<input type="submit" value="Change Password" />
+</form><br/>
+<h3>User Information (JSON)</h3>
+<pre id="userjson"></pre>
+<br/><a href="/content/newuser.html">Return to User Manager</a>
+</body>
+</html>
diff --git a/usermgr.html b/usermgr.html
new file mode 100644
index 0000000..4e7f0a9
--- /dev/null
+++ b/usermgr.html
@@ -0,0 +1,50 @@
+<html>
+<head>
+<title>Create User</title>
+<script src="/system/sling.js"></script>
+<script type="text/javascript">
+ function getJSON(url) {
+ var resp ;
+ var xmlHttp ;
+
+ resp = '' ;
+ xmlHttp = new XMLHttpRequest();
+
+ if(xmlHttp != null)
+ {
+ xmlHttp.open( "GET", url, false );
+ xmlHttp.send( null );
+ resp = xmlHttp.responseText;
+ }
+
+ return resp ;
+ }
+
+ function loadUsers() {
+ var jsontext = getJSON('/system/userManager/user.1.json');
+ var jsonar = jsontext.replace("{","").split("}")
+ for (var i = 0; i < jsonar.length; i++) {
+ thisuser = jsonar[i].split('"')[1];
+ if (thisuser.length > 0 && thisuser != 'anonymous') {
+ document.getElementById('userlist').innerHTML += '<li><a href="/home/users/' + thisuser[0] + '/' + thisuser + '.html">' + thisuser + '</a></li>';
+ }
+ }
+ }
+</script>
+</head>
+<body onLoad="loadUsers();">
+<h3>Create New User</h3>
+<form method="POST" action="/system/userManager/user.create.html">
+Username<input type="text" name=":name" onChange="document.getElementById('uid').value = this.value;" /><br/>
+Password:<input type="password" name="pwd" /><br/>
+Confirm:<input type="password" name="pwdConfirm" /><br/>
+<input type="hidden" name="uid" id="uid" />
+<input type="hidden" name="sling:resourceType" value="users/password" />
+<input type="submit" value="Create User" />
+</form>
+<h3>Existing Users</h3>
+ <ul id="userlist">
+ </ul>
+</body>
+</html>
+