2 require_once("../globals.php");
3 require_once("../../library/acl.inc");
4 require_once("$srcdir/sha1.js");
5 require_once("$srcdir/sql.inc");
6 require_once("$srcdir/formdata.inc.php");
7 require_once("$srcdir/options.inc.php");
8 require_once(dirname(__FILE__
) . "/../../library/classes/WSProvider.class.php");
9 require_once("$srcdir/erx_javascript.inc.php");
17 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
18 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
19 <link rel
="stylesheet" type
="text/css" href
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
20 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script
>
21 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.1.3.2.js"></script
>
22 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script
>
23 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
24 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/crypt/jsbn.js"></script
>
25 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/crypt/rsa.js"></script
>
27 <script src
="checkpwd_validation.js" type
="text/javascript"></script
>
29 <script language
="JavaScript">
30 function trimAll(sString
)
32 while (sString
.substring(0,1) == ' ')
34 sString
= sString
.substring(1, sString
.length
);
36 while (sString
.substring(sString
.length
-1, sString
.length
) == ' ')
38 sString
= sString
.substring(0,sString
.length
-1);
43 function submitform() {
44 if (document
.forms
[0].rumple
.value
.length
>0 && document
.forms
[0].stiltskin
.value
.length
>0 && document
.getElementById('fname').value
.length
>0 && document
.getElementById('lname').value
.length
>0) {
47 //Checking if secure password is enabled or disabled.
48 //If it is enabled and entered password is a weak password, alert the user to enter strong password.
49 if(document
.new_user
.secure_pwd
.value
== 1){
50 var password
= trim(document
.new_user
.stiltskin
.value
);
52 var pwdresult
= passwordvalidate(password
);
54 alert("<?php echo xl('The password must be at least eight characters, and should'); echo '\n'; echo xl('contain at least three of the four following items:'); echo '\n'; echo xl('A number'); echo '\n'; echo xl('A lowercase letter'); echo '\n'; echo xl('An uppercase letter'); echo '\n'; echo xl('A special character');echo '('; echo xl('not a letter or number'); echo ').'; echo '\n'; echo xl('For example:'); echo ' healthCare@09'; ?>");
58 } //secure_pwd if ends here
60 <?php
if($GLOBALS['erx_enable']){ ?
>
63 for(i
=0;i
<f
.length
;i++
){
64 if(f
[i
].type
=='text' && f
[i
].value
)
66 if(f
[i
].name
== 'rumple')
68 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
69 alertMsg +
= checkUsername(f
[i
].name
,f
[i
].value
);
71 else if(f
[i
].name
== 'fname' || f
[i
].name
== 'mname' || f
[i
].name
== 'lname')
73 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
74 alertMsg +
= checkUsername(f
[i
].name
,f
[i
].value
);
76 else if(f
[i
].name
== 'federaltaxid')
78 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,10);
79 alertMsg +
= checkFederalEin(f
[i
].name
,f
[i
].value
);
81 else if(f
[i
].name
== 'state_license_number')
83 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,10);
84 alertMsg +
= checkStateLicenseNumber(f
[i
].name
,f
[i
].value
);
86 else if(f
[i
].name
== 'npi')
88 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
89 alertMsg +
= checkTaxNpiDea(f
[i
].name
,f
[i
].value
);
91 else if(f
[i
].name
== 'federaldrugid')
93 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,30);
94 alertMsg +
= checkAlphaNumeric(f
[i
].name
,f
[i
].value
);
103 <?php
} // End erx_enable only include block?>
105 // get a public key to encrypt the password info and send
107 url
: '<?php echo $webroot; ?>/library/ajax/rsa_request.php',
109 success
: function(public_key
)
111 var key
= RSA
.getPublicKey(public_key
);
112 $
("input[name='userPass']").val(RSA
.encrypt($
("input[name='adminPass']").val(), key
));
113 $
("input[name='newauthPass']").val(RSA
.encrypt($
("input[name='stiltskin']").val(), key
));
114 $
("input[name='pk']").val(public_key
);
115 $
('input[name="adminPass"]').val('');
116 $
('input[name="stiltskin"]').val('');
117 document
.forms
[0].submit();
118 parent
.$
.fn
.fancybox
.close();
123 if (document
.forms
[0].rumple
.value
.length
<=0)
125 document
.forms
[0].rumple
.style
.backgroundColor
="red";
126 alert("<?php xl('Required field missing: Please enter the User Name','e');?>");
127 document
.forms
[0].rumple
.focus();
130 if (document
.forms
[0].stiltskin
.value
.length
<=0)
132 document
.forms
[0].stiltskin
.style
.backgroundColor
="red";
133 alert("<?php echo xl('Please enter the password'); ?>");
134 document
.forms
[0].stiltskin
.focus();
137 if(trimAll(document
.getElementById('fname').value
) == ""){
138 document
.getElementById('fname').style
.backgroundColor
="red";
139 alert("<?php xl('Required field missing: Please enter the First name','e');?>");
140 document
.getElementById('fname').focus();
143 if(trimAll(document
.getElementById('lname').value
) == ""){
144 document
.getElementById('lname').style
.backgroundColor
="red";
145 alert("<?php xl('Required field missing: Please enter the Last name','e');?>");
146 document
.getElementById('lname').focus();
151 function authorized_clicked() {
152 var f
= document
.forms
[0];
153 f
.calendar
.disabled
= !f
.authorized
.checked
;
154 f
.calendar
.checked
= f
.authorized
.checked
;
160 <body
class="body_top">
162 <span
class="title"><?php
xl('Add User','e'); ?
></span
> 
;</td
>
164 <a
class="css_button" name
='form_save' id
='form_save' href
='#' onclick
="return submitform()">
165 <span
><?php
xl('Save','e');?
></span
></a
>
166 <a
class="css_button large_button" id
='cancel' href
='#'>
167 <span
class='css_button_span large_button_span'><?php
xl('Cancel','e');?
></span
>
175 <form name
='new_user' method
='post' target
="_parent" action
="usergroup_admin.php"
176 onsubmit
='return top.restoreSession()'>
177 <input type
='hidden' name
='mode' value
='new_user'>
178 <input type
='hidden' name
='secure_pwd' value
="<?php echo $GLOBALS['secure_password']; ?>">
180 <INPUT TYPE
="HIDDEN" NAME
="userPass" VALUE
="">
181 <INPUT TYPE
="HIDDEN" NAME
="newauthPass" VALUE
="">
182 <INPUT TYPE
="HIDDEN" NAME
="pk" VALUE
="">
183 <span
class="bold"> 
;</span
>
185 <table border
=0 cellpadding
=0 cellspacing
=0 style
="width:600px;">
187 <td style
="width:150px;"><span
class="text"><?php
xl('Username','e'); ?
>: </span
></td
><td style
="width:220px;"><input type
=entry name
=rumple style
="width:120px;"> <span
class="mandatory"> 
;*</span
></td
>
188 <td style
="width:150px;"><span
class="text"><?php
xl('Password','e'); ?
>: </span
></td
><td style
="width:250px;"><input type
="entry" style
="width:120px;" name
=stiltskin
><span
class="mandatory"> 
;*</span
></td
>
191 <td style
="width:150px;"></td
><td style
="width:220px;"></span
></td
>
192 <TD style
="width:200px;"><span
class=text
><?php
xl('Your Password','e'); ?
>: </span
></TD
>
193 <TD
class='text' style
="width:280px;"><input type
='password' name
=adminPass style
="width:120px;" value
="" autocomplete
='off'><font
class="mandatory">*</font
></TD
>
197 <td
><span
class="text"<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>><?php
xl('Groupname','e'); ?
>: </span
></td
>
199 <select name
=groupname
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
201 $res = sqlStatement("select distinct name from groups");
203 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
204 $result2[$iter] = $row;
205 foreach ($result2 as $iter) {
206 print "<option value='".$iter{"name"}."'>" . $iter{"name"} . "</option>\n";
210 <td
><span
class="text"><?php
xl('Provider','e'); ?
>: </span
></td
><td
>
211 <input type
='checkbox' name
='authorized' value
='1' onclick
='authorized_clicked()' />
212  
; 
;<span
class='text'><?php
xl('Calendar','e'); ?
>:
213 <input type
='checkbox' name
='calendar' disabled
/>
217 <td
><span
class="text"><?php
xl('First Name','e'); ?
>: </span
></td
><td
><input type
=entry name
='fname' id
='fname' style
="width:120px;"><span
class="mandatory"> 
;*</span
></td
>
218 <td
><span
class="text"><?php
xl('Middle Name','e'); ?
>: </span
></td
><td
><input type
=entry name
='mname' style
="width:120px;"></td
>
221 <td
><span
class="text"><?php
xl('Last Name','e'); ?
>: </span
></td
><td
><input type
=entry name
='lname' id
='lname' style
="width:120px;"><span
class="mandatory"> 
;*</span
></td
>
222 <td
><span
class="text"><?php
xl('Default Facility','e'); ?
>: </span
></td
><td
><select style
="width:120px;" name
=facility_id
>
224 $fres = sqlStatement("select * from facility where service_location != 0 order by name");
226 for ($iter = 0;$frow = sqlFetchArray($fres);$iter++
)
227 $result[$iter] = $frow;
228 foreach($result as $iter) {
230 <option value
="<?php echo $iter{'id'};?>"><?php
echo $iter{'name'};?
></option
>
238 <td
><span
class="text"><?php
xl('Federal Tax ID','e'); ?
>: </span
></td
><td
><input type
=entry name
='federaltaxid' style
="width:120px;"></td
>
239 <td
><span
class="text"><?php
xl('Federal Drug ID','e'); ?
>: </span
></td
><td
><input type
=entry name
='federaldrugid' style
="width:120px;"></td
>
242 <td
><span
class="text"><?php
xl('UPIN','e'); ?
>: </span
></td
><td
><input type
="entry" name
="upin" style
="width:120px;"></td
>
243 <td
class='text'><?php
xl('See Authorizations','e'); ?
>: </td
>
244 <td
><select name
="see_auth" style
="width:120px;">
246 foreach (array(1 => xl('None'), 2 => xl('Only Mine'), 3 => xl('All')) as $key => $value)
248 echo " <option value='$key'";
249 echo ">$value</option>\n";
255 <td
><span
class="text"><?php
xl('NPI','e'); ?
>: </span
></td
><td
><input type
="entry" name
="npi" style
="width:120px;"></td
>
256 <td
><span
class="text"><?php
xl('Job Description','e'); ?
>: </span
></td
><td
><input type
="entry" name
="specialty" style
="width:120px;"></td
>
259 <!-- (CHEMED
) Calendar UI preference
-->
261 <td
><span
class="text"><?php
xl('Taxonomy','e'); ?
>: </span
></td
>
262 <td
><input type
="entry" name
="taxonomy" style
="width:120px;" value
="207Q00000X"></td
>
263 <td
><span
class="text"><?php
xl('Calendar UI','e'); ?
>: </span
></td
><td
><select name
="cal_ui" style
="width:120px;">
265 foreach (array(3 => xl('Outlook'), 1 => xl('Original'), 2 => xl('Fancy')) as $key => $value)
267 echo " <option value='$key'>$value</option>\n";
272 <!-- END (CHEMED
) Calendar UI preference
-->
275 <td
><span
class="text"><?php
xl('State License Number','e'); ?
>: </span
></td
>
276 <td
><input type
="text" name
="state_license_number" style
="width:120px;"></td
>
277 <td
class='text'><?php
xl('NewCrop eRX Role','e'); ?
>:</td
>
279 <?php
echo generate_select_list("erxrole", "newcrop_erx_role", '','','--Select Role--','','','',array('style'=>'width:120px')); ?
>
283 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
285 <td
class="text"><?php
xl('Default Warehouse','e'); ?
>: </td
>
288 echo generate_select_list('default_warehouse', 'warehouse',
292 <td
class="text"><?php
xl('Invoice Refno Pool','e'); ?
>: </td
>
295 echo generate_select_list('irnpool', 'irnpool', '',
296 xl('Invoice reference number pool, if used'));
303 // List the access control groups if phpgacl installed
304 if (isset($phpgacl_location) && acl_check('admin', 'acl')) {
307 <td
class='text'><?php
xl('Access Control','e'); ?
>:</td
>
308 <td
><select name
="access_group[]" multiple style
="width:120px;">
310 $list_acl_groups = acl_get_group_title_list();
311 $default_acl_group = 'Administrators';
312 foreach ($list_acl_groups as $value) {
313 if ($default_acl_group == $value) {
314 // Modified 6-2009 by BM - Translate group name if applicable
315 echo " <option value='$value' selected>" . xl_gacl_group($value) . "</option>\n";
318 // Modified 6-2009 by BM - Translate group name if applicable
319 echo " <option value='$value'>" . xl_gacl_group($value) . "</option>\n";
324 <td
><span
class="text"><?php
xl('Additional Info','e'); ?
>: </span
></td
>
325 <td
><textarea name
=info style
="width:120px;" cols
=27 rows
=4 wrap
=auto
></textarea
></td
>
328 <tr height
="25"><td colspan
="4"> 
;</td
></tr
>
336 <input type
="hidden" name
="newauthPass">
342 <tr
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
345 <form name
='new_group' method
='post' action
="usergroup_admin.php"
346 onsubmit
='return top.restoreSession()'>
348 <input type
=hidden name
=mode value
=new_group
>
349 <span
class="bold"><?php
xl('New Group','e'); ?
>:</span
>
351 <span
class="text"><?php
xl('Groupname','e'); ?
>: </span
><input type
=entry name
=groupname size
=10>
353 <span
class="text"><?php
xl('Initial User','e'); ?
>: </span
>
356 $res = sqlStatement("select distinct username from users where username != ''");
357 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
358 $result[$iter] = $row;
359 foreach ($result as $iter) {
360 print "<option value='".$iter{"username"}."'>" . $iter{"username"} . "</option>\n";
365 <input type
="submit" value
=<?php
xl('Save','e'); ?
>>
371 <tr
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
374 <form name
='new_group' method
='post' action
="usergroup_admin.php"
375 onsubmit
='return top.restoreSession()'>
376 <input type
=hidden name
=mode value
=new_group
>
377 <span
class="bold"><?php
xl('Add User To Group','e'); ?
>:</span
>
380 <?php
xl('User','e'); ?
>
384 $res = sqlStatement("select distinct username from users where username != ''");
385 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
386 $result3[$iter] = $row;
387 foreach ($result3 as $iter) {
388 print "<option value='".$iter{"username"}."'>" . $iter{"username"} . "</option>\n";
393 <span
class="text"><?php
xl('Groupname','e'); ?
>: </span
>
394 <select name
=groupname
>
396 $res = sqlStatement("select distinct name from groups");
398 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
399 $result2[$iter] = $row;
400 foreach ($result2 as $iter) {
401 print "<option value='".$iter{"name"}."'>" . $iter{"name"} . "</option>\n";
406 <input type
="submit" value
=<?php
xl('Add User To Group','e'); ?
>>
414 if (empty($GLOBALS['disable_non_default_groups'])) {
415 $res = sqlStatement("select * from groups order by name");
416 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
417 $result5[$iter] = $row;
419 foreach ($result5 as $iter) {
420 $grouplist{$iter{"name"}} .= $iter{"user"} .
421 "(<a class='link_submit' href='usergroup_admin.php?mode=delete_group&id=" .
422 $iter{"id"} . "' onclick='top.restoreSession()'>Remove</a>), ";
425 foreach ($grouplist as $groupname => $list) {
426 print "<span class='bold'>" . $groupname . "</span><br>\n<span class='text'>" .
427 substr($list,0,strlen($list)-2) . "</span><br>\n";
432 <script language
="JavaScript">
434 if ($alertmsg = trim($alertmsg)) {
435 echo "alert('$alertmsg');\n";
438 $
(document
).ready(function(){
439 $
("#cancel").click(function() {
440 parent
.$
.fn
.fancybox
.close();