Beispiel #1
0
 /**
  * Returns an HTML anchor tag that links to user lock/unlock action
  *
  * @param User $user User
  * @param string $label Link label
  * @return string HMTL anchor tag
  */
 public function userLockLink($user, $label = null)
 {
     if (!Zend_Registry::get('acl')->isUserAllowed('mvc:admin:users:edit', 'view')) {
         return '';
     }
     if (null === $label) {
         $label = $user->getLocked() ? 'Unlock' : 'Lock';
     }
     $class = ' class="userLockLink ss_sprite ss_lock' . ($user->getLocked() ? '_delete' : '') . '"';
     return '<a' . $class . ' id="userLockLink-' . $user->getId() . '" href="#">' . $label . '</a>';
 }
Beispiel #2
0
 /**
  * Set form field default values
  *
  * @param User $user
  * @return void
  */
 public function setDefaults(User $user)
 {
     $profile = $user->getProfile();
     parent::setDefaults(array('userId' => $user->getId(), 'username' => $user->getUsername(), 'role' => $user->getRole()->getId(), 'firstName' => $profile->getFirstName(), 'lastName' => $profile->getLastName(), 'email' => $user->getEmail(), 'phone' => $profile->getPhone(), 'active' => $user->getActive(), 'locked' => $user->getLocked()));
 }