Exemplo n.º 1
0
 public function show($id, $active = 0)
 {
     try {
         $this->profile = new Profile($id);
         $this->editable = (UserHelper::getProfileId() == $this->profile->getId() or UserHelper::isEditor());
         $this->is_owner = UserHelper::getProfileId() == $this->profile->getId();
         $this->is_allowed = $this->editable || UserHelper::viewProfile($this->profile);
         if (!$this->is_allowed) {
             throw new fValidationException('not allowed');
         }
         $this->username = $this->profile->getLoginName();
         $this->avatarfile = AVATAR_DIR . $this->username . '-avatar.jpg';
         $this->active = $active;
         $this->render('profile/show');
     } catch (fNotFoundException $e) {
         Slim::getInstance()->notFound();
     }
 }
Exemplo n.º 2
0
        <button type="submit" class="btn btn-danger btn-large">给下列用户群发邮件</button>
<br/>
<div class="progress progress-striped active" style="display:none">
  <div class="bar" style="width: 0%;"></div>
</div>

</form>
<?php 
}
if (isset($this->users)) {
    foreach ($this->users as $profile) {
        ?>
  <?php 
        $username = $profile->getLoginName();
        $avatarfile = AVATAR_DIR . $username . '-mini.jpg';
        $isAllowed = $this->editable || UserHelper::viewProfile($profile);
        ?>
  <article class="a-feed" id="user-<?php 
        echo $profile->getId();
        ?>
">
    <aside>
      <figure>
<?php 
        if ($isAllowed) {
            ?>
        <a href="<?php 
            echo SITE_BASE;
            ?>
/profile/<?php 
            echo $profile->getId();