Files
@ 26c2f4337bc7
Branch filter:
Location: hot67beta/administrator/components/com_users/views/user/tmpl/form.php
26c2f4337bc7
8.7 KiB
text/x-php
mneh
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | <?php defined('_JEXEC') or die('Restricted access'); ?>
<?php JHTML::_('behavior.tooltip'); ?>
<?php
$cid = JRequest::getVar( 'cid', array(0) );
$edit = JRequest::getVar('edit',true);
$text = intval($edit) ? JText::_( 'Edit' ) : JText::_( 'New' );
JToolBarHelper::title( JText::_( 'User' ) . ': <small><small>[ '. $text .' ]</small></small>' , 'user.png' );
JToolBarHelper::save();
JToolBarHelper::apply();
if ( $edit ) {
// for existing items the button is renamed `close`
JToolBarHelper::cancel( 'cancel', 'Close' );
} else {
JToolBarHelper::cancel();
}
JToolBarHelper::help( 'screen.users.edit' );
$cparams = JComponentHelper::getParams ('com_media');
?>
<?php
// clean item data
JFilterOutput::objectHTMLSafe( $user, ENT_QUOTES, '' );
if ($this->user->get('lastvisitDate') == "0000-00-00 00:00:00") {
$lvisit = JText::_( 'Never' );
} else {
$lvisit = JHTML::_('date', $this->user->get('lastvisitDate'), '%Y-%m-%d %H:%M:%S');
}
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&]", "i");
// do field validation
if (trim(form.name.value) == "") {
alert( "<?php echo JText::_( 'You must provide a name.', true ); ?>" );
} else if (form.username.value == "") {
alert( "<?php echo JText::_( 'You must provide a user login name.', true ); ?>" );
} else if (r.exec(form.username.value) || form.username.value.length < 2) {
alert( "<?php echo JText::_( 'WARNLOGININVALID', true ); ?>" );
} else if (trim(form.email.value) == "") {
alert( "<?php echo JText::_( 'You must provide an email address.', true ); ?>" );
} else if (form.gid.value == "") {
alert( "<?php echo JText::_( 'You must assign user to a group.', true ); ?>" );
} else if (((trim(form.password.value) != "") || (trim(form.password2.value) != "")) && (form.password.value != form.password2.value)){
alert( "<?php echo JText::_( 'Password do not match.', true ); ?>" );
} else if (form.gid.value == "29") {
alert( "<?php echo JText::_( 'WARNSELECTPF', true ); ?>" );
} else if (form.gid.value == "30") {
alert( "<?php echo JText::_( 'WARNSELECTPB', true ); ?>" );
} else {
submitform( pressbutton );
}
}
function gotocontact( id ) {
var form = document.adminForm;
form.contact_id.value = id;
submitform( 'contact' );
}
</script>
<form action="index.php" method="post" name="adminForm" autocomplete="off">
<div class="col width-45">
<fieldset class="adminform">
<legend><?php echo JText::_( 'User Details' ); ?></legend>
<table class="admintable" cellspacing="1">
<tr>
<td width="150" class="key">
<label for="name">
<?php echo JText::_( 'Name' ); ?>
</label>
</td>
<td>
<input type="text" name="name" id="name" class="inputbox" size="40" value="<?php echo $this->user->get('name'); ?>" />
</td>
</tr>
<tr>
<td class="key">
<label for="username">
<?php echo JText::_( 'Username' ); ?>
</label>
</td>
<td>
<input type="text" name="username" id="username" class="inputbox" size="40" value="<?php echo $this->user->get('username'); ?>" autocomplete="off" />
</td>
</tr>
<tr>
<td class="key">
<label for="email">
<?php echo JText::_( 'Email' ); ?>
</label>
</td>
<td>
<input class="inputbox" type="text" name="email" id="email" size="40" value="<?php echo $this->user->get('email'); ?>" />
</td>
</tr>
<tr>
<td class="key">
<label for="password">
<?php echo JText::_( 'New Password' ); ?>
</label>
</td>
<td>
<?php if(!$this->user->get('password')) : ?>
<input class="inputbox disabled" type="password" name="password" id="password" size="40" value="" disabled="disabled" />
<?php else : ?>
<input class="inputbox" type="password" name="password" id="password" size="40" value=""/>
<?php endif; ?>
</td>
</tr>
<tr>
<td class="key">
<label for="password2">
<?php echo JText::_( 'Verify Password' ); ?>
</label>
</td>
<td>
<?php if(!$this->user->get('password')) : ?>
<input class="inputbox disabled" type="password" name="password2" id="password2" size="40" value="" disabled="disabled" />
<?php else : ?>
<input class="inputbox" type="password" name="password2" id="password2" size="40" value=""/>
<?php endif; ?>
</td>
</tr>
<tr>
<td valign="top" class="key">
<label for="gid">
<?php echo JText::_( 'Group' ); ?>
</label>
</td>
<td>
<?php echo $this->lists['gid']; ?>
</td>
</tr>
<?php if ($this->me->authorize( 'com_users', 'block user' )) { ?>
<tr>
<td class="key">
<?php echo JText::_( 'Block User' ); ?>
</td>
<td>
<?php echo $this->lists['block']; ?>
</td>
</tr>
<?php } if ($this->me->authorize( 'com_users', 'email_events' )) { ?>
<tr>
<td class="key">
<?php echo JText::_( 'Receive System Emails' ); ?>
</td>
<td>
<?php echo $this->lists['sendEmail']; ?>
</td>
</tr>
<?php } if( $this->user->get('id') ) { ?>
<tr>
<td class="key">
<?php echo JText::_( 'Register Date' ); ?>
</td>
<td>
<?php echo JHTML::_('date', $this->user->get('registerDate'), '%Y-%m-%d %H:%M:%S');?>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'Last Visit Date' ); ?>
</td>
<td>
<?php echo $lvisit; ?>
</td>
</tr>
<?php } ?>
</table>
</fieldset>
</div>
<div class="col width-55">
<fieldset class="adminform">
<legend><?php echo JText::_( 'Parameters' ); ?></legend>
<table class="admintable">
<tr>
<td>
<?php
$params = $this->user->getParameters(true);
echo $params->render( 'params' );
?>
</td>
</tr>
</table>
</fieldset>
<fieldset class="adminform">
<legend><?php echo JText::_( 'Contact Information' ); ?></legend>
<?php if ( !$this->contact ) { ?>
<table class="admintable">
<tr>
<td>
<br />
<span class="note">
<?php echo JText::_( 'No Contact details linked to this User' ); ?>:
<br />
<?php echo JText::_( 'SEECOMPCONTACTFORDETAILS' ); ?>.
</span>
<br /><br />
</td>
</tr>
</table>
<?php } else { ?>
<table class="admintable">
<tr>
<td width="120" class="key">
<?php echo JText::_( 'Name' ); ?>
</td>
<td>
<strong>
<?php echo $this->contact[0]->name;?>
</strong>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'Position' ); ?>
</td>
<td >
<strong>
<?php echo $this->contact[0]->con_position;?>
</strong>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'Telephone' ); ?>
</td>
<td >
<strong>
<?php echo $this->contact[0]->telephone;?>
</strong>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'Fax' ); ?>
</td>
<td >
<strong>
<?php echo $this->contact[0]->fax;?>
</strong>
</td>
</tr>
<tr>
<td class="key">
<?php echo JText::_( 'Misc' ); ?>
</td>
<td >
<strong>
<?php echo $this->contact[0]->misc;?>
</strong>
</td>
</tr>
<?php if ($this->contact[0]->image) { ?>
<tr>
<td class="key">
<?php echo JText::_( 'Image' ); ?>
</td>
<td valign="top">
<img src="<?php echo JURI::root() . $cparams->get('image_path') . '/' . $this->contact[0]->image; ?>" align="middle" alt="<?php echo JText::_( 'Contact' ); ?>" />
</td>
</tr>
<?php } ?>
<tr>
<td class="key"> </td>
<td>
<div>
<br />
<input class="button" type="button" value="<?php echo JText::_( 'change Contact Details' ); ?>" onclick="gotocontact( '<?php echo $this->contact[0]->id; ?>' )" />
<i>
<br /><br />
'<?php echo JText::_( 'Components -> Contact -> Manage Contacts' ); ?>'
</i>
</div>
</td>
</tr>
</table>
<?php } ?>
</fieldset>
</div>
<div class="clr"></div>
<input type="hidden" name="id" value="<?php echo $this->user->get('id'); ?>" />
<input type="hidden" name="cid[]" value="<?php echo $this->user->get('id'); ?>" />
<input type="hidden" name="option" value="com_users" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="contact_id" value="" />
<?php if (!$this->me->authorize( 'com_users', 'email_events' )) { ?>
<input type="hidden" name="sendEmail" value="0" />
<?php } ?>
<?php echo JHTML::_( 'form.token' ); ?>
</form>
|