incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From enor...@apache.org
Subject svn commit: r1201348 - in /sling/trunk/samples/usermanager-ui/src/main/resources: SLING-INF/i18n/ css/usermanager/ images/ js/usermanager/ libs/sling/group/ libs/sling/groups/ libs/sling/user/ libs/sling/userManager/ libs/sling/users/
Date Sat, 12 Nov 2011 22:50:57 GMT
Author: enorman
Date: Sat Nov 12 22:50:56 2011
New Revision: 1201348

URL: http://svn.apache.org/viewvc?rev=1201348&view=rev
Log:
SLING-1562 improvements to the usermanager.ui sample
1. user/group delete action was broken when the app was not mounted at the root context
2. block rendering of several pages for the anonymous user
3. misc ui tweaks 

Removed:
    sling/trunk/samples/usermanager-ui/src/main/resources/images/ajax-loader.gif
Modified:
    sling/trunk/samples/usermanager-ui/src/main/resources/SLING-INF/i18n/resources.json
    sling/trunk/samples/usermanager-ui/src/main/resources/css/usermanager/usermanager.css
    sling/trunk/samples/usermanager-ui/src/main/resources/css/usermanager/usermanager.min.css
    sling/trunk/samples/usermanager-ui/src/main/resources/js/usermanager/usermanager.js
    sling/trunk/samples/usermanager-ui/src/main/resources/js/usermanager/usermanager.min.js
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/group/update_body.html.esp
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/body.html.esp
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/html.esp
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/searchresult.html.esp
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/user/update_body.html.esp
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/body.html.esp
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/html.esp
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/searchresult.html.esp
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/body.html.esp
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/html.esp
    sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/searchresult.html.esp

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/SLING-INF/i18n/resources.json
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/SLING-INF/i18n/resources.json?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/SLING-INF/i18n/resources.json (original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/SLING-INF/i18n/resources.json Sat
Nov 12 22:50:56 2011
@@ -77,7 +77,7 @@
         "prop.label.loginEnabled": {
             "jcr:primaryType": "sling:MessageEntry",
             "sling:key": "prop.label.loginEnabled",
-            "sling:message": "Login Enabled"
+            "sling:message": "Is Login Enabled"
         },
         "prop.label.loginEnabled.yes": {
             "jcr:primaryType": "sling:MessageEntry",

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/css/usermanager/usermanager.css
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/css/usermanager/usermanager.css?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/css/usermanager/usermanager.css
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/css/usermanager/usermanager.css
Sat Nov 12 22:50:56 2011
@@ -183,17 +183,13 @@ img, a img
     text-align: center;
 }
 
-#authorizables-body
-{    
-    min-width: 750px;   
-}
-
 #find-authorizables-quick-nav
 {
     padding: 2px 4px;
 }
 
-#authorizables-results-body
+#authorizables-results-body,
+#authorizables-results-progress
 {
     margin-top: 5px;
 }
@@ -207,7 +203,7 @@ img, a img
 #find-authorizables-quick-nav .ui-button-text-only .ui-button-text
 {
     line-height: 1;
-    padding: 3px 3px;
+    padding: 1px 1px;
     font-size: 10pt;        
 }
 #find-authorizables-block .ui-button-text-only .ui-button-text
@@ -262,6 +258,7 @@ img, a img
     font-weight: bold; 
     display: inline; 
     line-height: 33px; 
+    border-style: none;
 }
 
 
@@ -290,7 +287,7 @@ img, a img
 {
     float: left;
     display: inline;
-    width: 15%;
+    width: 20%;
     text-align: right;
 }
 
@@ -298,7 +295,7 @@ img, a img
 #create-group-form input
 {
     margin-left: 10px;
-    width: 75%;
+    width: 70%;
 }
 
 #create-user-form button,
@@ -341,7 +338,7 @@ img, a img
 {
     float: left;
     display: inline;
-    width: 15%;
+    width: 20%;
     text-align: right;
 }
 
@@ -352,7 +349,7 @@ img, a img
 #add-group-member-form input
 {
     margin-left: 10px;
-    width: 75%;
+    width: 70%;
 }
 
 #update-user-form button,
@@ -381,14 +378,14 @@ img, a img
     
 #update-password-form label 
 {
-    width: 15%;
+    width: 20%;
     text-align: right;
 }
 
 #update-password-form input 
 {
     margin-left: 10px;
-    width: 75%;
+    width: 70%;
 }
 
 #update-password-form button 
@@ -417,7 +414,7 @@ img, a img
 
 #disabledReasonPanel input 
 {
-	width: 57%;
+	width: 42%;
 }
 
 .prop-line 
@@ -461,7 +458,7 @@ label.error, label.error 
     color: red;
     font-style: italic;
     font-weight: bold;
-    margin-left: 15%;
+    margin-left: 20%;
     padding-left: 10px;
     text-align: left !important;
     width: auto !important;

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/css/usermanager/usermanager.min.css
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/css/usermanager/usermanager.min.css?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/css/usermanager/usermanager.min.css
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/css/usermanager/usermanager.min.css
Sat Nov 12 22:50:56 2011
@@ -36,11 +36,10 @@ img,a img{border:0}
 .info-msg-text{margin-left:5px}
 #find-authorizables-form fieldset{border:0;margin:0;padding:0;line-height:20px}
 .search-empty-msg{line-height:100px;font-size:large;font-weight:bold;text-align:center}
-#authorizables-body{min-width:750px}
 #find-authorizables-quick-nav{padding:2px 4px}
-#authorizables-results-body{margin-top:5px}
+#authorizables-results-body,#authorizables-results-progress{margin-top:5px}
 #find-authorizables-quick-nav label{width:auto;padding:3px 5px}
-#find-authorizables-quick-nav .ui-button-text-only .ui-button-text{line-height:1;padding:3px
3px;font-size:10pt}
+#find-authorizables-quick-nav .ui-button-text-only .ui-button-text{line-height:1;padding:1px
1px;font-size:10pt}
 #find-authorizables-block .ui-button-text-only .ui-button-text{line-height:1;padding:5px
5px;font-size:10pt}
 #search-result-paging .ui-button-text-only .ui-button-text{line-height:1;font-size:10pt}
 #search-result-paging span#current_page{margin-left:6px;margin-right:6px}
@@ -49,29 +48,29 @@ img,a img{border:0}
 #search-result td,#search-result th{padding:5px}
 #search-result tr.odd{background-color:#eee}
 #find-authorizables-header{margin-bottom:5px}
-#find-authorizables-header h3{font-size:14px;font-weight:bold;display:inline;line-height:33px}
+#find-authorizables-header h3{font-size:14px;font-weight:bold;display:inline;line-height:33px;border-style:none}
 #create-user-form,#create-group-form{margin:0;padding:0}
 #create-user-form fieldset,#create-group-form fieldset{border:0;margin:0;padding:0;line-height:20px}
-#create-user-form label,#create-group-form label{float:left;display:inline;width:15%;text-align:right}
-#create-user-form input,#create-group-form input{margin-left:10px;width:75%}
+#create-user-form label,#create-group-form label{float:left;display:inline;width:20%;text-align:right}
+#create-user-form input,#create-group-form input{margin-left:10px;width:70%}
 #create-user-form button,#create-group-form button{margin-left:10px}
 #update-user-form,#update-password-form,#update-group-form{margin:0;padding:0}
 #update-user-form fieldset,#update-password-form fieldset,#update-group-form fieldset,#remove-user-form
fieldset,#remove-group-form fieldset,#add-property-form fieldset,#add-group-member-form fieldset{border:0;margin:0;padding:0;line-height:20px}
-#update-user-form label,#update-password-form label,#update-group-form label,#add-property-form
label,#add-group-member-form label{float:left;display:inline;width:15%;text-align:right}
-#update-user-form input,#update-password-form input,#update-group-form input,#add-property-form
input,#add-group-member-form input{margin-left:10px;width:75%}
+#update-user-form label,#update-password-form label,#update-group-form label,#add-property-form
label,#add-group-member-form label{float:left;display:inline;width:20%;text-align:right}
+#update-user-form input,#update-password-form input,#update-group-form input,#add-property-form
input,#add-group-member-form input{margin-left:10px;width:70%}
 #update-user-form button,#update-password-form button,#update-group-form button{margin-left:10px}
 #update-user-form ol,#update-group-form ol{float:left;display:inline;width:65%;margin:0 5px
0 10px;padding-left:0;list-style-position:inside;list-style-type:none}
 #update-password-body{margin-top:10px}
-#update-password-form label{width:15%;text-align:right}
-#update-password-form input{margin-left:10px;width:75%}
+#update-password-form label{width:20%;text-align:right}
+#update-password-form input{margin-left:10px;width:70%}
 #update-password-form button{margin-left:10px}
 #loginStatusInput label,#loginStatusInput input{width:auto;float:none}
 #loginStatusInput{width:75%}
 #disabledReasonPanel label{width:auto;margin-left:15px;float:none}
-#disabledReasonPanel input{width:57%}
+#disabledReasonPanel input{width:42%}
 .prop-line{margin-bottom:5px;line-height:26px}
 .prop-line .remove-property,.prop-line .remove-member{position:absolute;margin:5px 5px}
 .ui-autocomplete-loading{background:white url('../../images/ui-anim_basic_16x16.gif') right
center no-repeat}
 .noscript-hide{display:none}
 input.error,textarea.error{border:1px dotted red}
-label.error,label.error{color:red;font-style:italic;font-weight:bold;margin-left:15%;padding-left:10px;text-align:left!important;width:auto!important}
\ No newline at end of file
+label.error,label.error{color:red;font-style:italic;font-weight:bold;margin-left:20%;padding-left:10px;text-align:left!important;width:auto!important}
\ No newline at end of file

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/js/usermanager/usermanager.js
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/js/usermanager/usermanager.js?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/js/usermanager/usermanager.js (original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/js/usermanager/usermanager.js Sat
Nov 12 22:50:56 2011
@@ -165,6 +165,9 @@ UserManager.Authorizables = {
             //reset the paging to the first page
             $('#searchOffset').val(0);
 
+            //clear value from the search input
+            $("#findAuthorizablesQuery").val("");
+            
             //do the search
             UserManager.Authorizables.runSearchFn();
             return false;
@@ -184,12 +187,9 @@ UserManager.Authorizables = {
                 $('#radioNone').attr('checked', true);
                 $('#radioNone').button('refresh');
             }
-
-            //reset the paging to the first page
-            $('#searchOffset').val(0);
             
             //do the search
-            UserManager.Authorizables.runSearchFn();
+            UserManager.Authorizables.runSearchFn(0);
             return false;
         });
 
@@ -210,8 +210,8 @@ UserManager.Authorizables = {
     progressFn: function() {
         //inject a progress block
         $('#authorizables-results-body')
-            .after('<div id="authorizables-results-progress" style="text-align:center"><img
src="' + UserManager.contextPath + '/css/usermgmt/images/ajax-loader.gif" alt="' + UserManager.messages["searching.progress.msg"]
+  '"/></div>');
-
+            .after('<div id="authorizables-results-progress" class="search-empty-msg ui-corner-all
ui-state-highlight">' + UserManager.messages["searching.progress.msg"] + '</div>');
+        
         //done with this.
         UserManager.Authorizables.progressFnId = null;
     },
@@ -287,6 +287,7 @@ UserManager.Authorizables = {
         $('#find-authorizables-quick-nav input[value="' + (hashParams.sp == undefined ? ""
: hashParams.sp) + '"]')
             .attr("checked", true)
             .button('refresh');
+        
         //fill in the offset value
         $('#searchOffset').val(hashParams.o == undefined ? "0" : hashParams.o);
 
@@ -541,7 +542,7 @@ UserManager.Group.Update = {
                 type: 'POST',
                 data: formData,
                 success: function( data, textStatus, xmlHttpRequest ) {
-                    $("#content").load(UserManager.contextPath + data.path + ".update_body.html",
function() {
+            		$("#update-group-body").parent().load(UserManager.contextPath + data.path +
".update_body.html", function() {
                         $("#update-group-body span.info-msg-text").html(UserManager.messages["group.updated.msg"]);
                         $("#update-group-body div.info-msg-block").show();
                     });
@@ -942,7 +943,7 @@ UserManager.User.Update = {
                 data: formData,
                 success: function( data, textStatus, xmlHttpRequest ) {
                     //reload the update body content
-                    $("#content").load(UserManager.contextPath + data.path + ".update_body.html",
function() {
+                    $("#update-user-body").parent().load(UserManager.contextPath + data.path
+ ".update_body.html", function() {
                         //inject a success message
                         $("#update-user-body span.info-msg-text").html(UserManager.messages["user.updated.msg"]);
                         $("#update-user-body div.info-msg-block").show();
@@ -952,6 +953,10 @@ UserManager.User.Update = {
                         //re-init the page since we just replaced the body
                         UserManager.User.Update.init();
 
+                        if ($("#update-password-form").length > 0) {
+                            UserManager.User.UpdatePassword.init();
+                        }
+
                         //make visible any elements that require scripting to be enabled

                         $(".noscript-hide").removeClass("noscript-hide");
                     }, 100);

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/js/usermanager/usermanager.min.js
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/js/usermanager/usermanager.min.js?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/js/usermanager/usermanager.min.js
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/js/usermanager/usermanager.min.js
Sat Nov 12 22:50:56 2011
@@ -43,6 +43,7 @@ if(b.error){UserManager.ErrorDlg.showErr
 UserManager.Authorizables={progressFnId:null,init:function(){$("#find-authorizables-quick-nav").buttonset().show();
 UserManager.Authorizables.applyResultStylesAndHandlers();
 $('#find-authorizables-quick-nav input[type = "radio"]').change(function(a){$("#searchOffset").val(0);
+$("#findAuthorizablesQuery").val("");
 UserManager.Authorizables.runSearchFn();
 return false
 });
@@ -51,13 +52,12 @@ $("button#findAuthorizablesBtn").click(f
 $("#radioAll").button("refresh")
 }else{$("#radioNone").attr("checked",true);
 $("#radioNone").button("refresh")
-}$("#searchOffset").val(0);
-UserManager.Authorizables.runSearchFn();
+}UserManager.Authorizables.runSearchFn(0);
 return false
 });
 $(window).bind("hashchange",UserManager.Authorizables.runSearchFromHashFn);
 $(window).trigger("hashchange")
-},progressFn:function(){$("#authorizables-results-body").after('<div id="authorizables-results-progress"
style="text-align:center"><img src="'+UserManager.contextPath+'/css/usermgmt/images/ajax-loader.gif"
alt="'+UserManager.messages["searching.progress.msg"]+'"/></div>');
+},progressFn:function(){$("#authorizables-results-body").after('<div id="authorizables-results-progress"
class="search-empty-msg ui-corner-all ui-state-highlight">'+UserManager.messages["searching.progress.msg"]+"</div>");
 UserManager.Authorizables.progressFnId=null
 },clearProgressFn:function(){if(UserManager.Authorizables.progressFnId!=null){clearTimeout(UserManager.Authorizables.progressFnId);
 UserManager.Authorizables.progressFnId=null
@@ -154,7 +154,7 @@ $("#redirect").attr("disabled",true);
 c=b.serialize();
 $("#redirect").removeAttr("disabled");
 $("#update-group-body div.info-msg-block").hide();
-$.ajax({url:a,type:"POST",data:c,success:function(e,g,f){$("#content").load(UserManager.contextPath+e.path+".update_body.html",function(){$("#update-group-body
span.info-msg-text").html(UserManager.messages["group.updated.msg"]);
+$.ajax({url:a,type:"POST",data:c,success:function(e,g,f){$("#update-group-body").parent().load(UserManager.contextPath+e.path+".update_body.html",function(){$("#update-group-body
span.info-msg-text").html(UserManager.messages["group.updated.msg"]);
 $("#update-group-body div.info-msg-block").show()
 });
 setTimeout(function(){UserManager.Group.Update.init();
@@ -277,11 +277,12 @@ $("#redirect").attr("disabled",true);
 d=c.serialize();
 $("#redirect").removeAttr("disabled");
 $("#update-user-body div.info-msg-block").hide();
-$.ajax({url:b,type:"POST",data:d,success:function(e,h,g){$("#content").load(UserManager.contextPath+e.path+".update_body.html",function(){$("#update-user-body
span.info-msg-text").html(UserManager.messages["user.updated.msg"]);
+$.ajax({url:b,type:"POST",data:d,success:function(e,h,g){$("#update-user-body").parent().load(UserManager.contextPath+e.path+".update_body.html",function(){$("#update-user-body
span.info-msg-text").html(UserManager.messages["user.updated.msg"]);
 $("#update-user-body div.info-msg-block").show()
 });
 setTimeout(function(){UserManager.User.Update.init();
-$(".noscript-hide").removeClass("noscript-hide")
+if($("#update-password-form").length>0){UserManager.User.UpdatePassword.init()
+}$(".noscript-hide").removeClass("noscript-hide")
 },100)
 },error:UserManager.ErrorDlg.errorHandler});
 return false

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/group/update_body.html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/group/update_body.html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/group/update_body.html.esp
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/group/update_body.html.esp
Sat Nov 12 22:50:56 2011
@@ -173,7 +173,7 @@ function displayName(path) {
 
 <% if (canRemove) { %>
 <div id="remove-group-dialog" title='<%=rb.getString("dialog.title.confirm.remove")%>'
style="display:none">
-    <form id='remove-group-form' action="<%=resource.path%>.delete.html" method="post">
+    <form id='remove-group-form' action="<%=request.contextPath%><%=resource.path%>.delete.html"
method="post">
     <fieldset>
         <input type="hidden" name=":redirect" value="<%=request.contextPath%>/system/userManager/group.html"
/>
         <p>

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/body.html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/body.html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/body.html.esp
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/body.html.esp
Sat Nov 12 22:50:56 2011
@@ -15,6 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
+if (!isLoggedIn) {
+     //anonymous user can't do anything here, so don't show a page.
+     response.sendError(404);
+} else {
 
 var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
 
@@ -26,4 +31,6 @@ request.setAttribute("page.title", title
 
 //delegate the 'authorizables' script to render the page
 sling.include(resource.path + ".body.html", "sling/userManager");
+
+} /* endelse */
 %>
\ No newline at end of file

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/html.esp (original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/html.esp Sat Nov
12 22:50:56 2011
@@ -15,6 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
+if (!isLoggedIn) {
+     //anonymous user can't do anything here, so don't show a page.
+     response.sendError(404);
+} else {
 
 var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
 
@@ -31,4 +36,6 @@ request.setAttribute("body.template", re
 
 //render the page using the default page template
 sling.include(resource.path + ".page.html", "sling/usermgmt");
+
+} /*endelse */
 %>
\ No newline at end of file

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/searchresult.html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/searchresult.html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/searchresult.html.esp
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/groups/searchresult.html.esp
Sat Nov 12 22:50:56 2011
@@ -15,10 +15,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
+if (!isLoggedIn) {
+     //anonymous user can't do anything here, so don't show a page.
+     response.sendError(404);
+} else {
 
 var searchType = 2; //search only groups
 request.setAttribute("search.type", searchType);
 
 //delegate the 'authorizables' script to render the page
 sling.include(resource.path + ".searchresult.html", "sling/userManager");
+
+} /* endelse (isLoggedIn) */
 %>
\ No newline at end of file

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/user/update_body.html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/user/update_body.html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/user/update_body.html.esp
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/user/update_body.html.esp
Sat Nov 12 22:50:56 2011
@@ -152,14 +152,14 @@ if ("admin".equals(request.getRemoteUser
                 } /* endwhile */
             %>
 
-            <p id="updateSubmitBtns" class="ui-helper-clearfix">
+            <div id="updateSubmitBtns" class="ui-helper-clearfix">
                 <label>&#160;</label>
                 <% if (canEdit) { %><button accesskey="u" id="updateUserBtn" type="submit"><%=rb.getString("button.save")%></button><%
} %>
                 <span class="noscript-hide">
                 <% if (canRemove) { %><a href="#" id="removeUserLink"><%=rb.getString("link.remove")%></a>
| <% } %>
                 <% if (canEdit) { %><a href="#" id="add_property"><%=rb.getString("link.add.property")%></a><%
} %>
                 </span>
-            </p>
+            </div>
         </fieldset>
     </form>
 </div>
@@ -177,7 +177,7 @@ if ("admin".equals(request.getRemoteUser
 
 <% if (canRemove) { %>
 <div id="remove-user-dialog" title='<%=rb.getString("dialog.title.confirm.remove")%>'
style="display:none">
-    <form id='remove-user-form' action="<%=resource.path%>.delete.html" method="post">
+    <form id='remove-user-form' action="<%=request.contextPath%><%=resource.path%>.delete.html"
method="post">
     <fieldset>
         <input type="hidden" name=":redirect" value="<%=request.contextPath%>/system/userManager/user.html"
/>
         <p>

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/body.html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/body.html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/body.html.esp
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/body.html.esp
Sat Nov 12 22:50:56 2011
@@ -16,6 +16,11 @@
  * limitations under the License.
  */
 
+var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
+if (!isLoggedIn) {
+     //anonymous user can't do anything here, so don't show a page.
+     response.sendError(404);
+} else {
 var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
 
 var title = request.getAttribute("page.title");
@@ -45,7 +50,7 @@ if (oParam == null) {
             <input type="hidden" id="searchOffset" name="o" value="<%=oParam%>"
/>
 
             <div id='find-authorizables-header' class="ui-widget-header ui-corner-all
ui-helper-clearfix">
-                <h3 class="usermgmt-header"><%=title%></h3>
+                <h3 class="ui-widget-header usermgmt-header"><%=title%></h3>
                 <span id="find-authorizables-block">
                     <input id="findAuthorizablesQuery" type="text" name="q" value="<%=qParam%>"
/>
                     <button accesskey="s" id="findAuthorizablesBtn" type="submit"><%=rb.getString("button.search")%></button>
@@ -71,4 +76,5 @@ if (oParam == null) {
     </form>
     
     <% sling.include(resource.path + ".searchresult.html"); %>    
-</div>
\ No newline at end of file
+</div>
+<% } /*endelse (isLoggedIn) */ %>
\ No newline at end of file

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/html.esp
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/html.esp
Sat Nov 12 22:50:56 2011
@@ -15,20 +15,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
+if (!isLoggedIn) {
+     //anonymous user can't do anything here, so don't show a page.
+     response.sendError(404);
+} else {
+	var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
 
-var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
+	//header options
+	request.setAttribute("page.title", rb.getString("page.title.find.authorizables"));
 
-//header options
-request.setAttribute("page.title", rb.getString("page.title.find.authorizables"));
+	//page sidebar template
+	request.setAttribute("sidebar.template", resource.path + ".sidebar.html");
+	request.setAttribute("sidebar.template.options", "sling/usermgmt");
 
-//page sidebar template
-request.setAttribute("sidebar.template", resource.path + ".sidebar.html");
-request.setAttribute("sidebar.template.options", "sling/usermgmt");
+	//page body template
+	request.setAttribute("body.template", resource.path + ".body.html");
+	//request.setAttribute("body.template.options", "sling/userManager");
 
-//page body template
-request.setAttribute("body.template", resource.path + ".body.html");
-//request.setAttribute("body.template.options", "sling/userManager");
-
-//render the page using the default page template
-sling.include(resource.path + ".page.html", "sling/usermgmt");
+	//render the page using the default page template
+	sling.include(resource.path + ".page.html", "sling/usermgmt");
+}
 %>
\ No newline at end of file

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/searchresult.html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/searchresult.html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/searchresult.html.esp
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/userManager/searchresult.html.esp
Sat Nov 12 22:50:56 2011
@@ -15,6 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
+if (!isLoggedIn) {
+     //anonymous user can't do anything here, so don't show a page.
+     response.sendError(404);
+} else {
 
 var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
 var searchType = request.getAttribute("search.type");
@@ -115,4 +120,5 @@ var noMatches = searchResults != null &&
         </tfoot>
     </table>
 <% } /*endelse*/ %>
-</div>
\ No newline at end of file
+</div>
+<% } /*endelse (isLoggedIn) */ %>
\ No newline at end of file

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/body.html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/body.html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/body.html.esp (original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/body.html.esp Sat
Nov 12 22:50:56 2011
@@ -15,6 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
+if (!isLoggedIn) {
+     //anonymous user can't do anything here, so don't show a page.
+     response.sendError(404);
+} else {
 
 var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
 
@@ -26,4 +31,6 @@ request.setAttribute("page.title", title
 
 //delegate the 'authorizables' script to render the page
 sling.include(resource.path + ".body.html", "sling/userManager");
+
+} /* endelse */
 %>
\ No newline at end of file

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/html.esp (original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/html.esp Sat Nov
12 22:50:56 2011
@@ -15,6 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
+if (!isLoggedIn) {
+     //anonymous user can't do anything here, so don't show a page.
+     response.sendError(404);
+} else {
 
 var rb = request.getResourceBundle("org.apache.sling.usermgr.Resources", null);
 
@@ -31,4 +36,6 @@ request.setAttribute("body.template", re
 
 //render the page using the default page template
 sling.include(resource.path + ".page.html", "sling/usermgmt");
+
+} /* endelse */
 %>
\ No newline at end of file

Modified: sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/searchresult.html.esp
URL: http://svn.apache.org/viewvc/sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/searchresult.html.esp?rev=1201348&r1=1201347&r2=1201348&view=diff
==============================================================================
--- sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/searchresult.html.esp
(original)
+++ sling/trunk/samples/usermanager-ui/src/main/resources/libs/sling/users/searchresult.html.esp
Sat Nov 12 22:50:56 2011
@@ -15,10 +15,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+var isLoggedIn = request.getUserPrincipal() != null && !"anonymous".equals(request.getRemoteUser());
+if (!isLoggedIn) {
+     //anonymous user can't do anything here, so don't show a page.
+     response.sendError(404);
+} else {
 
 var searchType = 1; //search only users
 request.setAttribute("search.type", searchType);
 
 //delegate the 'authorizables' script to render the page
 sling.include(resource.path + ".searchresult.html", "sling/userManager");
+
+} /* endelse */
 %>
\ No newline at end of file



Mime
View raw message