forked from community/device-mgt-core
revert-70aa11f8
parent
d5950afe7a
commit
0ccaa9fe81
0
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.user.listing/public/templates/listing.hbs → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/templates/listing.hbs
0
components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.user.listing/public/templates/listing.hbs → components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.users/public/templates/listing.hbs
@ -1,113 +0,0 @@
|
|||||||
|
|
||||||
<!-- content/body -->
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<!-- content -->
|
|
||||||
<div id="user-create-form" class="container col-centered wr-content">
|
|
||||||
<div class="wr-form">
|
|
||||||
<p class="page-sub-title">Add User</p>
|
|
||||||
<p>Please note that * sign represents required fields of data.</p>
|
|
||||||
<hr />
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-8">
|
|
||||||
<div id="user-create-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
<label class="wr-input-label" title="List of available secondary user stores">
|
|
||||||
User Stores
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</label>
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<select id="userStore" class="form-control select" >
|
|
||||||
<option>PRIMARY</option>
|
|
||||||
{{#each userStores}}
|
|
||||||
<option>{{this}}</option>
|
|
||||||
{{/each}}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<label class="wr-input-label">
|
|
||||||
User Name *
|
|
||||||
</label>
|
|
||||||
<br>
|
|
||||||
<label class="wr-input-label">
|
|
||||||
( {{usernameHelpText}} )
|
|
||||||
</label>
|
|
||||||
<div id="usernameInputField" class="form-group wr-input-control">
|
|
||||||
<input limit="{{charLimit}}" type="text" id="username" data-regex="{{usernameJSRegEx}}" data-errormsg="{{usernameRegExViolationErrorMsg}}" class="form-control"/>
|
|
||||||
<span class=" usernameError hidden glyphicon glyphicon-remove form-control-feedback"></span>
|
|
||||||
<label class="error usernameEmpty hidden" for="summary">This field is required. Username should be in minimum 3 characters long and do not include any whitespaces.</label>
|
|
||||||
</div>
|
|
||||||
<label class="wr-input-label">First Name *</label>
|
|
||||||
<div id="firstNameField" class="form-group wr-input-control">
|
|
||||||
<input type="text" id="firstname" data-regex="{{firstnameJSRegEx}}" data-errormsg="{{firstnameRegExViolationErrorMsg}}" class="form-control"/>
|
|
||||||
<span class="glyphicon glyphicon-remove form-control-feedback hidden fnError"></span>
|
|
||||||
<label class=" hidden error fnError" for="summary">This field is required.</label>
|
|
||||||
</div>
|
|
||||||
<label class="wr-input-label">Last Name *</label>
|
|
||||||
<div id="lastNameField" class="form-group wr-input-control">
|
|
||||||
<input type="text" id="lastname" data-regex="{{lastnameJSRegEx}}" data-errormsg="{{lastnameRegExViolationErrorMsg}}" class="form-control"/>
|
|
||||||
<span class="glyphicon glyphicon-remove form-control-feedback hidden lnError"></span>
|
|
||||||
<label class=" hidden error lnError" for="summary">This field is required.</label>
|
|
||||||
</div>
|
|
||||||
<label class="wr-input-label">
|
|
||||||
Email Address * <br>
|
|
||||||
( ex: sam@gmail.com )
|
|
||||||
</label>
|
|
||||||
<div id="emailField" class=" form-group wr-input-control">
|
|
||||||
<input type="email" id="emailAddress" class="form-control"/>
|
|
||||||
<span class="glyphicon glyphicon-remove form-control-feedback hidden emailError"></span>
|
|
||||||
<label class=" hidden error email-required" for="summary">This field is required.</label>
|
|
||||||
<label class=" hidden error email-invalid" for="summary">Invalid Email Address.</label>
|
|
||||||
</div>
|
|
||||||
<label class="wr-input-label" title="Optional field that can have 0-to-many roles for the user">
|
|
||||||
User Roles
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</label>
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<select id="roles" class="form-control select2" multiple="multiple">
|
|
||||||
{{#each roles}}
|
|
||||||
<option>{{this}}</option>
|
|
||||||
{{/each}}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<button id="add-user-btn" class="wr-btn">Add User</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="user-created-msg" class="container col-centered wr-content hidden">
|
|
||||||
<div class="wr-form">
|
|
||||||
<p class="page-sub-title">User was added successfully.</p>
|
|
||||||
<br>
|
|
||||||
An invitation mail will be sent to this user to initiate device enrollment.
|
|
||||||
Below QR code can also be used to enroll a device.
|
|
||||||
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div class="panel-body">
|
|
||||||
<div class="qr-code col-lg-5 col-md-6 col-centered"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br>Please click <b>"Add Another User"</b>, if you wish to add another user or click
|
|
||||||
<b>"View User List"</b> to complete the process and go back to the user list.
|
|
||||||
<hr />
|
|
||||||
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/users'">View User List</button>
|
|
||||||
<a href="{{@app.context}}/user/add" class="cu-btn-inner">
|
|
||||||
<span class="fw-stack">
|
|
||||||
<i class="fw fw-ring fw-stack-2x"></i>
|
|
||||||
<i class="fw fw-add fw-stack-1x"></i>
|
|
||||||
</span>
|
|
||||||
Add Another User
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /content -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- /content/body -->
|
|
||||||
|
|
||||||
{{#zone "bottomJs"}}
|
|
||||||
{{js "js/bottomJs.js"}}
|
|
||||||
{{/zone}}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "1.0.0"
|
|
||||||
}
|
|
@ -1,91 +0,0 @@
|
|||||||
|
|
||||||
<!-- content/body -->
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<!-- content -->
|
|
||||||
<div id="user-create-form" class="container col-centered wr-content">
|
|
||||||
<div class="wr-form">
|
|
||||||
<p class="page-sub-title">Edit User</p>
|
|
||||||
<p>Please note that * sign represents required fields of data.</p>
|
|
||||||
<hr />
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-8">
|
|
||||||
<div id="user-create-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
<label class="wr-input-label">
|
|
||||||
User Name <br>
|
|
||||||
</label>
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<input type="text" id="username" data-regex="{{usernameJSRegEx}}" data-errormsg="{{usernameRegExViolationErrorMsg}}" class="form-control" value="{{editUser.username}}" disabled/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<label class="wr-input-label">First Name *</label>
|
|
||||||
<div id="firstNameField" class="form-group wr-input-control">
|
|
||||||
<input type="text" id="firstname" data-regex="{{firstnameJSRegEx}}" data-errormsg="{{firstnameRegExViolationErrorMsg}}" class="form-control" value="{{editUser.firstname}}"/>
|
|
||||||
<span class="glyphicon glyphicon-remove form-control-feedback hidden fnError"></span>
|
|
||||||
<label class=" hidden error fnError" for="summary">This field is required.</label>
|
|
||||||
</div>
|
|
||||||
<label class="wr-input-label">Last Name *</label>
|
|
||||||
<div id="lastNameField" class="form-group wr-input-control">
|
|
||||||
<input type="text" id="lastname" data-regex="{{lastnameJSRegEx}}" data-errormsg="{{lastnameRegExViolationErrorMsg}}" class="form-control" value="{{editUser.lastname}}"/>
|
|
||||||
<span class="glyphicon glyphicon-remove form-control-feedback hidden lnError"></span>
|
|
||||||
<label class=" hidden error lnError" for="summary">This field is required.</label>
|
|
||||||
</div>
|
|
||||||
<label class="wr-input-label">
|
|
||||||
Email Address * <br>
|
|
||||||
( ex: sam@gmail.com )
|
|
||||||
</label>
|
|
||||||
<div id="emailField" class=" form-group wr-input-control">
|
|
||||||
<input type="email" id="emailAddress" class="form-control" value="{{editUser.emailAddress}}"/>
|
|
||||||
<span class="glyphicon glyphicon-remove form-control-feedback hidden emailError"></span>
|
|
||||||
<label class=" hidden error email-required" for="summary">This field is required.</label>
|
|
||||||
<label class=" hidden error email-invalid" for="summary">Invalid Email Address.</label>
|
|
||||||
</div>
|
|
||||||
<label class="wr-input-label" title="Optional field that can have 0-to-many roles for the user">
|
|
||||||
User Roles
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</label>
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<select id="roles" class="form-control select2" multiple="multiple" selectedVals="
|
|
||||||
{{#each usersRoles}}
|
|
||||||
{{this}},
|
|
||||||
{{/each}}
|
|
||||||
">
|
|
||||||
{{#each userRoles}}
|
|
||||||
<option >{{this}}</option>
|
|
||||||
{{/each}}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
<button id="add-user-btn" class="wr-btn">Save User</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="user-created-msg" class="container col-centered wr-content hidden">
|
|
||||||
<div class="wr-form">
|
|
||||||
<p class="page-sub-title">User was updated successfully.</p>
|
|
||||||
|
|
||||||
<br>Please click <b>"View Updated User"</b>, if you wish to view the updated user or click
|
|
||||||
<b>"View User List"</b> to complete the process and go back to the user list.
|
|
||||||
<hr />
|
|
||||||
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/users'">View User List</button>
|
|
||||||
<a href="{{@app.context}}/user/view?username={{editUser.username}}" class="cu-btn-inner">
|
|
||||||
<span class="fw-stack">
|
|
||||||
<i class="fw fw-ring fw-stack-2x"></i>
|
|
||||||
<i class="fw fw-view fw-stack-1x"></i>
|
|
||||||
</span>
|
|
||||||
View Updated User
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /content -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /content/body -->
|
|
||||||
{{#zone "bottomJs"}}
|
|
||||||
{{js "js/bottomJs.js"}}
|
|
||||||
{{/zone}}
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* WSO2 Inc. 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a context with the user object to be populated by the edit-user page.
|
|
||||||
*
|
|
||||||
* @param context Object that gets updated with the dynamic state of this page to be presented
|
|
||||||
* @returns {*} A context object that returns the dynamic state of this page to be presented
|
|
||||||
*/
|
|
||||||
function onRequest(context) {
|
|
||||||
var userModule = require("/app/modules/user.js")["userModule"];
|
|
||||||
var devicemgtProps = require('/app/conf/devicemgt-props.js').config();
|
|
||||||
var userName = request.getParameter("username");
|
|
||||||
|
|
||||||
if (userName) {
|
|
||||||
var userStore = "PRIMARY";
|
|
||||||
if (userName.indexOf("/") > -1) {
|
|
||||||
userStore = userName.substr(0, userName.indexOf('/'));
|
|
||||||
}
|
|
||||||
var response = userModule.getUser(userName);
|
|
||||||
|
|
||||||
if (response["status"] == "success") {
|
|
||||||
context["editUser"] = response["content"];
|
|
||||||
}
|
|
||||||
|
|
||||||
response = userModule.getRolesByUsername(userName);
|
|
||||||
if (response["status"] == "success") {
|
|
||||||
context["usersRoles"] = response["content"];
|
|
||||||
}
|
|
||||||
response = userModule.getRolesByUserStore(userStore);
|
|
||||||
if (response["status"] == "success") {
|
|
||||||
context["userRoles"] = response["content"];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
context["usernameJSRegEx"] = devicemgtProps.userValidationConfig.usernameJSRegEx;
|
|
||||||
context["usernameRegExViolationErrorMsg"] = devicemgtProps.userValidationConfig.usernameRegExViolationErrorMsg;
|
|
||||||
context["firstnameJSRegEx"] = devicemgtProps.userValidationConfig.firstnameJSRegEx;
|
|
||||||
context["firstnameRegExViolationErrorMsg"] = devicemgtProps.userValidationConfig.firstnameRegExViolationErrorMsg;
|
|
||||||
context["lastnameJSRegEx"] = devicemgtProps.userValidationConfig.lastnameJSRegEx;
|
|
||||||
context["lastnameRegExViolationErrorMsg"] = devicemgtProps.userValidationConfig.lastnameRegExViolationErrorMsg;
|
|
||||||
return context;
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "1.0.0"
|
|
||||||
}
|
|
@ -1,299 +0,0 @@
|
|||||||
|
|
||||||
<!-- content -->
|
|
||||||
<div id="loading-content" class="col-centered">
|
|
||||||
{{#if removePermitted}}
|
|
||||||
<input type="hidden" id="can-remove" value="true"/>
|
|
||||||
{{/if}}
|
|
||||||
{{#if editPermitted}}
|
|
||||||
<input type="hidden" id="can-edit" value="true"/>
|
|
||||||
{{/if}}
|
|
||||||
{{#if viewPermitted}}
|
|
||||||
<input type="hidden" id="can-view" value="true"/>
|
|
||||||
{{/if}}
|
|
||||||
{{#if invitePermitted}}
|
|
||||||
<input type="hidden" id="can-invite" value="true"/>
|
|
||||||
{{/if}}
|
|
||||||
{{#if resetPasswordPermitted}}
|
|
||||||
<input type="hidden" id="can-reset-password" value="true"/>
|
|
||||||
{{/if}}
|
|
||||||
<i class="fw fw-settings fw-spin fw-2x"></i>
|
|
||||||
|
|
||||||
Loading users . . .
|
|
||||||
<br>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="user-listing-status" class="raw hidden">
|
|
||||||
<ul style="list-style-type: none;">
|
|
||||||
<li class="message message-info" >
|
|
||||||
<h4>
|
|
||||||
<i class="icon fw fw-info"></i>
|
|
||||||
<a id="user-listing-status-msg"></a>
|
|
||||||
</h4>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="user-table" data-user={{adminUser}}>
|
|
||||||
<table class="table table-striped table-hover list-table display responsive nowrap data-table grid-view"
|
|
||||||
id="user-grid">
|
|
||||||
<thead>
|
|
||||||
<tr class="sort-row">
|
|
||||||
<th class="no-sort"></th>
|
|
||||||
<th class="no-sort"></th>
|
|
||||||
<th>By Username</th>
|
|
||||||
<th class="no-sort"></th>
|
|
||||||
<th class="no-sort"></th>
|
|
||||||
</tr>
|
|
||||||
<tr class="filter-row filter-box">
|
|
||||||
<th colspan="4">
|
|
||||||
<label class="wr-input-label" for="search-by-username">
|
|
||||||
By Username
|
|
||||||
</label>
|
|
||||||
<input id="search-by-username" type="text" class="form-control"
|
|
||||||
placeholder="Search By Username">
|
|
||||||
</th>
|
|
||||||
<th style="vertical-align:bottom;">
|
|
||||||
<button id="search-btn" class="wr-btn">
|
|
||||||
Search
|
|
||||||
</button>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr class="bulk-action-row" id="invite-user-button">
|
|
||||||
<th colspan="5">
|
|
||||||
<ul class="tiles">
|
|
||||||
<li class="square">
|
|
||||||
<a href="#" data-click-event="remove-form" class="btn square-element invite-user-link"
|
|
||||||
data-toggle="modal" data-target="#modalDemo">
|
|
||||||
<span class="icon fw-stack">
|
|
||||||
<i class="fw fw-ring fw-stack-2x"></i>
|
|
||||||
<i class="fw fw-invitation fw-stack-1x"></i>
|
|
||||||
</span>
|
|
||||||
Invite Selected
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="ast-container">
|
|
||||||
|
|
||||||
<br class="c-both"/>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<br class="c-both"/>
|
|
||||||
<div id="content-filter-types" style="display: none">
|
|
||||||
<div class="sort-title">Sort By</div>
|
|
||||||
<div class="sort-options">
|
|
||||||
<a href="#">By Username</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="invite-user-modal-content" class="hide">
|
|
||||||
<div class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
|
||||||
<h3>
|
|
||||||
An invitation mail will be sent to the selected user(s) to initiate an enrolment process.
|
|
||||||
Do you wish to continue ?
|
|
||||||
</h3>
|
|
||||||
<div class="buttons">
|
|
||||||
<a href="#" id="invite-user-yes-link" class="btn-operations">
|
|
||||||
yes
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a href="#" id="invite-user-cancel-link" class="btn-operations">
|
|
||||||
No
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="invite-user-success-content" class="hide">
|
|
||||||
<div class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
|
||||||
<h3>User invitation email for enrollment was successfully sent.</h3>
|
|
||||||
<div class="buttons">
|
|
||||||
<a href="#" id="invite-user-success-link" class="btn-operations">
|
|
||||||
Ok
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="invite-user-error-content" class="hide">
|
|
||||||
<div class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
|
||||||
<h3>An unexpected error occurred. Try again later.</h3>
|
|
||||||
<div class="buttons">
|
|
||||||
<a href="#" id="invite-user-error-link" class="btn-operations">
|
|
||||||
Ok
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="remove-user-modal-content" class="hide">
|
|
||||||
<div class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
|
||||||
<h3>Do you really want to remove this user ?</h3>
|
|
||||||
|
|
||||||
<div class="buttons">
|
|
||||||
<a href="#" id="remove-user-yes-link" class="btn-operations">
|
|
||||||
Remove
|
|
||||||
</a>
|
|
||||||
<a href="#" id="remove-user-cancel-link" class="btn-operations">
|
|
||||||
Cancel
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="remove-user-success-content" class="hide">
|
|
||||||
<div class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
|
||||||
<h3>Done. User was successfully removed.</h3>
|
|
||||||
<div class="buttons">
|
|
||||||
<a href="#" id="remove-user-success-link" class="btn-operations">
|
|
||||||
Ok
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="remove-user-error-content" class="hide">
|
|
||||||
<div class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
|
||||||
<h3>An unexpected error occurred. Please try again later.</h3>
|
|
||||||
|
|
||||||
<div class="buttons">
|
|
||||||
<a href="#" id="remove-user-error-link" class="btn-operations">
|
|
||||||
Ok
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="errorUsers" class="hide">
|
|
||||||
<div class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
|
||||||
<h3>
|
|
||||||
<span class="fw-stack">
|
|
||||||
<i class="fw fw-ring fw-stack-2x"></i>
|
|
||||||
<i class="fw fw-error fw-stack-1x"></i>
|
|
||||||
</span>
|
|
||||||
Operation cannot be performed !
|
|
||||||
</h3>
|
|
||||||
<h4>
|
|
||||||
Please select a user or a list of users to send invitation emails.
|
|
||||||
</h4>
|
|
||||||
<div class="buttons">
|
|
||||||
<a href="javascript:hidePopup()" class="btn-operations">
|
|
||||||
Ok
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="errorUserView" class="hide">
|
|
||||||
<div class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
|
||||||
<h3>
|
|
||||||
<span class="fw-stack">
|
|
||||||
<i class="fw fw-ring fw-stack-2x"></i>
|
|
||||||
<i class="fw fw-error fw-stack-1x"></i>
|
|
||||||
</span>
|
|
||||||
Unauthorized action!
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="reset-password-window" class="hide">
|
|
||||||
<input type="hidden" id="user" value="{{user.username}}">
|
|
||||||
<div class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
|
||||||
<h3>
|
|
||||||
<span class="fw-stack">
|
|
||||||
<i class="fw fw-ring fw-stack-2x"></i>
|
|
||||||
<i class="fw fw-key fw-stack-1x"></i>
|
|
||||||
</span>
|
|
||||||
Reset Password
|
|
||||||
<br>
|
|
||||||
</h3>
|
|
||||||
<div id="notification-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
<h4>
|
|
||||||
Enter new password
|
|
||||||
<br><br>
|
|
||||||
<div>
|
|
||||||
<input type="password" class="form-control modal-input operationDataKeys" id="new-password" data-key="message"/>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
Retype new password
|
|
||||||
<br><br>
|
|
||||||
<div>
|
|
||||||
<input type="password" class="form-control modal-input operationDataKeys" id="confirmed-password" data-key="message"/>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
</h4>
|
|
||||||
<div class="buttons">
|
|
||||||
<a href="#" id="reset-password-yes-link" class="btn-operations">
|
|
||||||
Save
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a href="#" id="reset-password-cancel-link" class="btn-operations">
|
|
||||||
Cancel
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="reset-password-success-content" class="hide">
|
|
||||||
<div class="content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-5 col-md-6 col-centered">
|
|
||||||
<h3>Password reset is successful.</h3>
|
|
||||||
<div class="buttons">
|
|
||||||
<a href="#" id="reset-password-success-link" class="btn-operations">
|
|
||||||
Ok
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{#zone "common-navigation"}}
|
|
||||||
<!--Later add the navigation menu from here-->
|
|
||||||
{{/zone}}
|
|
||||||
{{#zone "bottomJs"}}
|
|
||||||
<script id="user-listing" data-current-user="{{currentUser.username}}" src="{{@unit.publicUri}}/templates/listing.hbs" type="text/x-handlebars-template" ></script>
|
|
||||||
{{js "js/listing.js"}}
|
|
||||||
{{/zone}}
|
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* WSO2 Inc. 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
function onRequest(context) {
|
|
||||||
var userModule = require("/app/modules/user.js")["userModule"];
|
|
||||||
var deviceMgtProps = require("/app/conf/devicemgt-props.js").config();
|
|
||||||
context["permissions"] = userModule.getUIPermissions();
|
|
||||||
if (userModule.isAuthorized("/permission/admin/device-mgt/users/delete")) {
|
|
||||||
context["removePermitted"] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (userModule.isAuthorized("/permission/admin/device-mgt/users/remove")) {
|
|
||||||
context["removePermitted"] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (userModule.isAuthorized("/permission/admin/device-mgt/users/update")) {
|
|
||||||
context["editPermitted"] = true;
|
|
||||||
}
|
|
||||||
if (userModule.isAuthorized("/permission/admin/device-mgt/users/view")) {
|
|
||||||
context["viewPermitted"] = true;
|
|
||||||
}
|
|
||||||
if (userModule.isAuthorized("/permission/admin/device-mgt/users/invite")) {
|
|
||||||
context["invitePermitted"] = true;
|
|
||||||
}
|
|
||||||
if (userModule.isAuthorized("/permission/admin/device-mgt/users/reset-password")) {
|
|
||||||
context["resetPasswordPermitted"] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
context["adminUser"] = deviceMgtProps.adminUser;
|
|
||||||
return context;
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"version" : "1.0.0"
|
|
||||||
}
|
|
@ -1,129 +0,0 @@
|
|||||||
{{#zone "contentTitle"}}
|
|
||||||
<div class="row wr-device-board">
|
|
||||||
<div class="col-lg-12 wr-secondary-bar">
|
|
||||||
<label class="device-id device-select" data-username="{{user.username}}">
|
|
||||||
{{#if user.firstname}}
|
|
||||||
{{user.firstname}} {{user.lastname}}
|
|
||||||
{{else}}
|
|
||||||
{{user.username}}
|
|
||||||
{{/if}}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{/zone}}
|
|
||||||
|
|
||||||
<div class="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;">
|
|
||||||
<div class="media">
|
|
||||||
<div class="media-left media-middle asset-image col-xs-2 col-sm-2 col-md-2 col-lg-2">
|
|
||||||
<div class="thumbnail icon" style="margin-bottom: 43px"><i class="square-element text fw fw-user"></i></div>
|
|
||||||
<div class="media">
|
|
||||||
{{#if editPermitted}}
|
|
||||||
<button class="wr-btn"
|
|
||||||
onclick="location.href='{{@app.context}}/users/edit-user?username={{user.username}}';"
|
|
||||||
id="sortUpdateBtn"
|
|
||||||
style="width: 100%; vertical-align: bottom; background-color: #7fa030;"><span><i
|
|
||||||
class="fw fw-edit"></i> Edit</span></button>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="media-body asset-desc add-padding-left-5x">
|
|
||||||
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">Profile Overview</div>
|
|
||||||
{{#defineZone "user-detail-properties"}}
|
|
||||||
<table class="table table-responsive table-striped" id="members">
|
|
||||||
<tbody>
|
|
||||||
<tr role="row" class="even">
|
|
||||||
<td class="sorting_1" style="padding:10px 15px; width: 7%;">Username</td>
|
|
||||||
<td style="padding:10px 15px;">{{user.username}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr role="row" class="odd">
|
|
||||||
<td class="sorting_1" style="padding:10px 15px;">First Name</td>
|
|
||||||
<td style="padding:10px 15px;">{{user.firstname}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr role="row" class="even">
|
|
||||||
<td class="sorting_1" style="padding:10px 15px;">Last Name</td>
|
|
||||||
<td style="padding:10px 15px;">{{user.lastname}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr role="row" class="even">
|
|
||||||
<td class="sorting_1" style="padding:10px 15px;">Email</td>
|
|
||||||
<td style="padding:10px 15px;">{{user.emailAddress}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr role="row" class="even">
|
|
||||||
<td class="sorting_1" style="padding:10px 15px;">Roles</td>
|
|
||||||
<td style="padding:10px 15px;">
|
|
||||||
{{#each userRoles}}
|
|
||||||
<option selected="selected">{{this}}</option>
|
|
||||||
{{/each}}
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{{/defineZone}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="media">
|
|
||||||
<div class="media-left col-xs-12 col-sm-2 col-md-2 col-lg-2">
|
|
||||||
<ul class="list-group" role="tablist">
|
|
||||||
<li class="active"><a class="list-group-item" href="#enrolled_devices" role="tab"
|
|
||||||
data-toggle="tab" aria-controls="enrolled_devices">Enrolled Devices</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{{#defineZone "user-enrolled-devices"}}
|
|
||||||
<div class="media-body add-padding-left-5x remove-padding-xs tab-content">
|
|
||||||
<div class="panel-group tab-content">
|
|
||||||
<div class="panel panel-default tab-pane active" id="enrolled_devices"
|
|
||||||
role="tabpanel" aria-labelledby="enrolled_devices">
|
|
||||||
<div class="panel-heading">Enrolled Devices by
|
|
||||||
{{#if user.firstname}}
|
|
||||||
{{user.firstname}} {{user.lastname}}
|
|
||||||
{{else}}
|
|
||||||
{{user.username}}
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<div id="enrolled_devices-container">
|
|
||||||
<div class="panel-body">
|
|
||||||
{{#each devices}}
|
|
||||||
<div class="wr-list-group wr-sortable policy-list">
|
|
||||||
<span class="list-group-item" id="{{id}}">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-3 clearfix">
|
|
||||||
<span class="wr-list-icon">
|
|
||||||
<div class="thumbnail icon">
|
|
||||||
<img class="square-element text fw "
|
|
||||||
src="{{thumb}}"/>
|
|
||||||
</div>
|
|
||||||
</span>
|
|
||||||
<span class="wr-list-desc">
|
|
||||||
<h3 class="wr-list-name">{{name}}</h3>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-6">
|
|
||||||
</div>
|
|
||||||
<div class="col-lg-3">
|
|
||||||
<span class="list-group-item-actions">
|
|
||||||
<a href="{{@app.context}}/device/{{type}}?id={{deviceIdentifier}}"
|
|
||||||
class="cu-btn-inner policy-view-link" data-id="{{deviceIdentifier}}">
|
|
||||||
<span class="fw-stack">
|
|
||||||
<i class="fw fw-ring fw-stack-2x"></i>
|
|
||||||
<i class="fw fw-view fw-stack-1x"></i>
|
|
||||||
</span>
|
|
||||||
View
|
|
||||||
</a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
<br class="c-both"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{/defineZone}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
||||||
*
|
|
||||||
* WSO2 Inc. 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a context with the user object to be populated by the edit-user page.
|
|
||||||
*
|
|
||||||
* @param context Object that gets updated with the dynamic state of this page to be presented
|
|
||||||
* @returns {*} A context object that returns the dynamic state of this page to be presented
|
|
||||||
*/
|
|
||||||
function onRequest(context) {
|
|
||||||
var userModule = require("/app/modules/user.js")["userModule"];
|
|
||||||
|
|
||||||
var userName = request.getParameter("username");
|
|
||||||
|
|
||||||
var user, userRoles, devices;
|
|
||||||
|
|
||||||
if (userName) {
|
|
||||||
var response = userModule.getUser(userName);
|
|
||||||
|
|
||||||
if (response["status"] == "success") {
|
|
||||||
user = response["content"];
|
|
||||||
user.domain = response["userDomain"];
|
|
||||||
}
|
|
||||||
|
|
||||||
response = userModule.getRolesByUsername(userName);
|
|
||||||
if (response["status"] == "success") {
|
|
||||||
userRoles = response["content"];
|
|
||||||
}
|
|
||||||
var deviceModule = require("/app/modules/device.js").deviceModule;
|
|
||||||
devices = deviceModule.getDevices(userName);
|
|
||||||
}
|
|
||||||
return {"user": user, "userRoles": userRoles, "devices": devices};
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "1.0.0"
|
|
||||||
}
|
|
Loading…
Reference in new issue