public function afterStoreCallback()
 {
     if ($this->isDirty()) {
         //add notification to writer of review
         if (!$this->review['host_id'] && $this->review['user_id'] !== $this['user_id']) {
             PersonalNotifications::add($this->review['user_id'], URLHelper::getURL("plugins.php/lernmarktplatz/market/discussion/" . $this['review_id'] . "#comment_" . $this->getId()), sprintf(_("%s hat einen Kommentar zu Ihrem Review geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id'])), "comment_" . $this->getId(), Icon::create("support", "clickable"));
         }
         //add notification to all users of this servers who discussed this review but are neither the new
         //commentor nor the writer of the review
         $statement = DBManager::get()->prepare("\n                SELECT user_id\n                FROM lernmarktplatz_comments\n                WHERE review_id = :review_id\n                    AND host_id IS NULL\n                GROUP BY user_id\n            ");
         $statement->execute(array('review_id' => $this->review->getId()));
         foreach ($statement->fetchAll(PDO::FETCH_COLUMN, 0) as $user_id) {
             if (!in_array($user_id, array($this->review['user_id'], $this['user_id']))) {
                 PersonalNotifications::add($user_id, URLHelper::getURL("plugins.php/lernmarktplatz/market/discussion/" . $this['review_id'] . "#comment_" . $this->getId()), sprintf(_("%s hat auch einen Kommentar geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id'])), "comment_" . $this->getId(), Icon::create("support", "clickable"));
             }
         }
         //only push if the comment is from this server and the material-server is different
         if (!$this['host_id']) {
             $myHost = LernmarktplatzHost::thisOne();
             $data = array();
             $data['host'] = array('name' => $myHost['name'], 'url' => $myHost['url'], 'public_key' => $myHost['public_key']);
             $data['data'] = $this->toArray();
             $data['data']['foreign_comment_id'] = $data['data']['comment_id'];
             unset($data['data']['comment_id']);
             unset($data['data']['id']);
             unset($data['data']['user_id']);
             unset($data['data']['host_id']);
             $user_description_datafield = DataField::find(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")) ?: DataField::findOneBySQL("name = ?", array(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")));
             if ($user_description_datafield) {
                 $datafield_entry = DatafieldEntryModel::findOneBySQL("range_id = ? AND datafield_id = ?", array($this['user_id'], $user_description_datafield->getId()));
             }
             $data['user'] = array('user_id' => $this['user_id'], 'name' => get_fullname($this['user_id']), 'avatar' => Avatar::getAvatar($this['user_id'])->getURL(Avatar::NORMAL), 'description' => $datafield_entry ? $datafield_entry['content'] : null);
             $statement = DBManager::get()->prepare("\n                    SELECT host_id\n                    FROM lernmarktplatz_comments\n                    WHERE review_id = :review_id\n                        AND host_id IS NOT NULL\n                    GROUP BY host_id\n                ");
             $statement->execute(array('review_id' => $this->review->getId()));
             $hosts = $statement->fetchAll(PDO::FETCH_COLUMN, 0);
             if ($this->review['host_id'] && !in_array($this->review['host_id'], $hosts)) {
                 $hosts[] = $this->review['host_id'];
             }
             if ($this->review->material['host_id'] && !in_array($this->review->material['host_id'], $hosts)) {
                 $hosts[] = $this->review->material['host_id'];
             }
             foreach ($hosts as $host_id) {
                 $remote = new LernmarktplatzHost($host_id);
                 if (!$remote->isMe()) {
                     $review_id = $this->review['foreign_review_id'] ?: $this->review->getId();
                     if ($this->review['foreign_review_id']) {
                         if ($this->review->host_id === $remote->getId()) {
                             $host_hash = null;
                         } else {
                             $host_hash = md5($this->review->host['public_key']);
                         }
                     } else {
                         $host_hash = md5($myHost['public_key']);
                     }
                     $remote->pushDataToEndpoint("add_comment/" . $review_id . "/" . $host_hash, $data);
                 }
             }
         }
     }
 }
 public function afterStoreCallback()
 {
     if (!$this->material['host_id'] && $this->material['user_id'] !== $GLOBALS['user']->id) {
         PersonalNotifications::add($this->material['user_id'], URLHelper::getURL("plugins.php/lernmarktplatz/market/details/" . $this->material->getId() . "#review_" . $this->getId()), $this->isNew() ? sprintf(_("%s hat ein Review zu '%s' geschrieben."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id']), $this->material['name']) : sprintf(_("%s hat ein Review zu '%s' verändert."), $this['host_id'] ? LernmarktplatzUser::find($this['user_id'])->name : get_fullname($this['user_id']), $this->material['name']), "review_" . $this->getId(), Icon::create("support", "clickable"));
     }
     //only push if the comment is from this server and the material-server is different
     if ($this->material['host_id'] && !$this['host_id'] && $this->isDirty()) {
         $remote = new LernmarktplatzHost($this->material['host_id']);
         $myHost = LernmarktplatzHost::thisOne();
         $data = array();
         $data['host'] = array('name' => $myHost['name'], 'url' => $myHost['url'], 'public_key' => $myHost['public_key']);
         $data['data'] = $this->toArray();
         $data['data']['foreign_review_id'] = $data['data']['review_id'];
         unset($data['data']['review_id']);
         unset($data['data']['id']);
         unset($data['data']['user_id']);
         unset($data['data']['host_id']);
         $user_description_datafield = DataField::find(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")) ?: DataField::findOneBySQL("name = ?", array(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")));
         if ($user_description_datafield) {
             $datafield_entry = DatafieldEntryModel::findOneBySQL("range_id = ? AND datafield_id = ?", array($this['user_id'], $user_description_datafield->getId()));
         }
         $data['user'] = array('user_id' => $this['user_id'], 'name' => get_fullname($this['user_id']), 'avatar' => Avatar::getAvatar($this['user_id'])->getURL(Avatar::NORMAL), 'description' => $datafield_entry ? $datafield_entry['content'] : null);
         if (!$remote->isMe()) {
             $remote->pushDataToEndpoint("add_review/" . $this->material['foreign_material_id'], $data);
         }
     }
 }
Beispiel #3
0
 /**
  * Mapping function where to find what
  * @param type $object the object
  * @param type $function the called function
  * @return string output
  */
 private static function map($object, $function)
 {
     /**
      * If you want to add an object to the helper simply add to this array
      */
     $mapping = array('User' => array('link' => function ($obj) {
         return URLHelper::getLink('dispatch.php/profile', array('username' => $obj->username));
     }, 'name' => function ($obj) {
         return htmlReady($obj->getFullname());
     }, 'avatar' => function ($obj) {
         return Avatar::getAvatar($obj->id, $obj->username)->getImageTag(Avatar::SMALL, array('title' => htmlReady($obj->getFullname('no_title'))));
     }), 'Course' => array('link' => function ($obj) {
         return URLHelper::getLink('seminar_main.php', array('auswahl' => $obj->id));
     }, 'name' => function ($obj) {
         return htmlReady($obj->name);
     }, 'avatar' => function ($obj) {
         return CourseAvatar::getAvatar($obj->id)->getImageTag($size = CourseAvatar::SMALL, array('title' => htmlReady($obj->name)));
     }));
     /*
      * Some php magic to call the right function if it exists
      */
     if ($object && $mapping[get_class($object)]) {
         return $mapping[get_class($object)][$function]($object);
     }
     return "";
 }
Beispiel #4
0
 function setUp()
 {
     $stub = $this->getMock('Seminar_Perm');
     // Configure the stub.
     $stub->expects($this->any())->method('have_perm')->will($this->returnValue(true));
     $GLOBALS['perm'] = $stub;
     $GLOBALS['DYNAMIC_CONTENT_URL'] = "/dynamic";
     $GLOBALS['DYNAMIC_CONTENT_PATH'] = "/dynamic";
     $this->avatar_id = "123456789";
     $this->avatar = Avatar::getAvatar($this->avatar_id);
 }
Beispiel #5
0
 /**
  * Export of a single user
  * 
  * @param User $user Userobject
  * @return String vCard export string
  */
 private static function exportUser(User $user)
 {
     // If user is not visible export nothing
     if (!get_visibility_by_id($user->id)) {
         return "";
     }
     // vCard exportheader
     $vCard['BEGIN'] = 'VCARD';
     $vCard['VERSION'] = '3.0';
     $vCard['PRODID'] = 'Stud.IP//' . $GLOBALS['UNI_NAME_CLEAN'] . '//DE';
     $vCard['REV'] = date('Y-m-d  H:i:s');
     $vCard['TZ'] = date('O');
     // User specific data
     //Fullname
     $vCard['FN'] = studip_utf8encode($user->getFullname());
     //Name
     $vCard['N'][] = studip_utf8encode($user->Nachname);
     $vCard['N'][] = studip_utf8encode($user->Vorname);
     $vCard['N'][] = studip_utf8encode($user->info->title_rear);
     $vCard['N'][] = studip_utf8encode($user->info->title_front);
     // Adress
     if (Visibility::verify('privadr', $user->id)) {
         $vCard['ADR;TYPE=HOME'] = studip_utf8encode($user->info->privadr);
     }
     // Tel
     if (Visibility::verify('private_phone', $user->id)) {
         $vCard['TEL;TYPE=HOME'] = studip_utf8encode($user->info->privatnr);
     }
     if (Visibility::verify('private_cell', $user->id)) {
         $vCard['TEL;TYPE=CELL'] = studip_utf8encode($user->info->privatcell);
     }
     // Email
     if (get_local_visibility_by_id($user->id, 'email')) {
         $vCard['EMAIL'] = studip_utf8encode($user->email);
     }
     // Photo
     if (Visibility::verify('picture', $user->id)) {
         // Fetch avatar
         $avatar = Avatar::getAvatar($user->id);
         // Only export if
         if ($avatar->is_customized()) {
             $vCard['PHOTO;JPEG;ENCODING=BASE64'] = base64_encode(file_get_contents($avatar->getFilename(Avatar::NORMAL)));
         }
     }
     // vCard end
     $vCard['END'] = 'VCARD';
     // Produce string
     foreach ($vCard as $index => $value) {
         $exportString .= $value ? $index . ':' . (is_array($value) ? join(';', $value) : $value) . "\r\n" : "";
     }
     return $exportString;
 }
Beispiel #6
0
 function up()
 {
     foreach (glob($GLOBALS['DYNAMIC_CONTENT_PATH'] . '/user/*.jpg') as $value) {
         if (preg_match('/\\/([0-9a-f]+).jpg$/', $value, $matches)) {
             try {
                 Avatar::getAvatar($matches[1])->createFrom($value);
             } catch (Exception $e) {
                 $this->announce('Exception while converting avatar "%s"', $value);
                 $this->write($e->getMessage() . "\n");
             }
             @unlink($value);
         }
     }
 }
Beispiel #7
0
 /**
  * getUser - retrieves data of a user
  *
  * @get /user/:user_id
  * @get /user
  */
 public function getUser($user_id = '')
 {
     $user_id = $user_id ?: $GLOBALS['user']->id;
     $user = \User::find($user_id);
     if (!$user) {
         $this->halt(404, sprintf('User %s not found', $user_id));
     }
     $visibilities = get_local_visibility_by_id($user_id, 'homepage');
     if (is_array(json_decode($visibilities, true))) {
         $visibilities = json_decode($visibilities, true);
     } else {
         $visibilities = array();
     }
     $get_field = function ($field, $visibility) use($user_id, $user, $visibilities) {
         if (!$user[$field] || !is_element_visible_for_user($GLOBALS['user']->id, $user_id, $visibilities[$visibility])) {
             return '';
         }
         return $user[$field];
     };
     $avatar = \Avatar::getAvatar($user_id);
     $user = array('user_id' => $user_id, 'username' => $user['username'], 'name' => self::getNamesOfUser($user), 'perms' => $user['perms'], 'email' => get_visible_email($user_id), 'avatar_small' => $avatar->getURL(\Avatar::SMALL), 'avatar_medium' => $avatar->getURL(\Avatar::MEDIUM), 'avatar_normal' => $avatar->getURL(\Avatar::NORMAL), 'avatar_original' => $avatar->getURL(\Avatar::ORIGINAL), 'phone' => $get_field('privatnr', 'private_phone'), 'homepage' => $get_field('Home', 'homepage'), 'privadr' => strip_tags($get_field('privadr', 'privadr')));
     $query = "SELECT value\n                  FROM user_config\n                  WHERE field = ? AND user_id = ?";
     $statement = \DBManager::get()->prepare($query);
     $statement->execute(array('SKYPE_NAME', $user_id));
     $user['skype'] = $statement->fetchColumn() ?: '';
     $statement->closeCursor();
     if ($user['skype']) {
         $statement->execute(array('SKYPE_ONLINE_STATUS', $user_id));
         $user['skype_show'] = (bool) $statement->fetchColumn();
     } else {
         $user['skype_show'] = false;
     }
     // Data fields
     $datafields = array();
     foreach (\DataFieldEntry::getDataFieldEntries($user_id, 'user') as $entry) {
         if (!$entry->isVisible()) {
             continue;
         }
         if (!\Visibility::verify($entry->getID(), $user_id)) {
             continue;
         }
         $datafields[] = array('type' => $entry->getType(), 'id' => $entry->getId(), 'name' => $entry->getName(), 'value' => $entry->getValue());
     }
     $user['datafields'] = $datafields;
     $this->etag(md5(serialize($user)));
     return $user;
 }
Beispiel #8
0
 /**
  * Ajax action used for searching persons.
  *
  * @param $name string name of MultiPersonSearch object
  */
 public function ajax_search_action($name)
 {
     $searchterm = Request::get("s");
     $searchterm = str_replace(",", " ", $searchterm);
     $searchterm = preg_replace('/\\s+/', ' ', $searchterm);
     $result = array();
     // execute searchobject if searchterm is at least 3 chars long
     if (strlen($searchterm) >= 3) {
         $mp = MultiPersonSearch::load($name);
         $searchObject = $mp->getSearchObject();
         $result = array_map(function ($r) {
             return $r['user_id'];
         }, $searchObject->getResults($searchterm, array(), 50));
         $result = User::findMany($result, 'ORDER BY nachname asc, vorname asc');
         $alreadyMember = $mp->getDefaultSelectedUsersIDs();
     }
     $output = array();
     foreach ($result as $user) {
         $output[] = array('user_id' => $user->id, 'avatar' => Avatar::getAvatar($user->id)->getURL(Avatar::SMALL), 'text' => $user->nachname . ", " . $user->vorname . " -- " . $user->perms . " (" . $user->username . ")", 'member' => in_array($user->id, $alreadyMember));
     }
     $this->render_json($output);
 }
Beispiel #9
0
 /**
  * Upload a new avatar or removes the current avatar.
  * Upon Sends an information email to the user if the action was not invoked
  * by himself.
  */
 public function upload_action()
 {
     $this->check_ticket();
     if (Request::submitted('reset')) {
         Avatar::getAvatar($this->user->user_id)->reset();
         Visibility::removePrivacySetting('picture', $this->user->user_id);
         $this->reportSuccess(_('Bild gelöscht.'));
     } elseif (Request::submitted('upload')) {
         try {
             Avatar::getAvatar($this->user->user_id)->createFromUpload('imgfile');
             NotificationCenter::postNotification('AvatarDidUpload', $this->user->user_id);
             $message = _('Die Bilddatei wurde erfolgreich hochgeladen. ' . 'Eventuell sehen Sie das neue Bild erst, nachdem Sie diese Seite ' . 'neu geladen haben (in den meisten Browsern F5 drücken).');
             $this->reportSuccess($message);
             setTempLanguage($this->user->user_id);
             $this->postPrivateMessage(_("Ein neues Bild wurde hochgeladen.\n"));
             restoreLanguage();
             Visibility::addPrivacySetting(_('Eigenes Bild'), 'picture', 'commondata', 1, $this->user->user_id);
         } catch (Exception $e) {
             $this->reportError($e->getMessage());
         }
     }
     $this->redirect('settings/avatar');
 }
Beispiel #10
0
?>
:
                <? foreach (array_slice($related_users, 0, 3) as $key => $user_id) {
                    if ($key > 0) {
                        echo ", ";
                    }
                    echo get_fullname($user_id);
                } ?>
                <? if (count($related_users) > 3) : ?>
                    , ...
                <? endif ?>
            </div>
        </div>
        <div class="related_users">
            <? foreach ($related_users as $user_id) {
                echo Avatar::getAvatar($user_id)->getImageTag(Avatar::SMALL);
            } ?>
        </div>
    <? else : ?>
        <div class="contextinfo" title="<?php 
echo _("Öffentlich");
?>
">
            <div class="name"><?php 
echo _("Öffentlich");
?>
</div>
        </div>
    <? endif ?>
    <? if ($thread['context_type'] === "public") : ?>
        <? $sharingusers = $thread->getSharingUsers() ?>
Beispiel #11
0
                        <?php 
echo _('Aktionen');
?>
                    </th>
                </tr>
            </thead>
            <tbody>
                <? foreach ($invitedMembers as $p) : ?>
                    <tr>
                        <td>
                            <a href="<?php 
echo URLHelper::getLink('dispatch.php/profile?username='******'username']);
?>
">
                                <?php 
echo Avatar::getAvatar($p['user_id'])->getImageTag(Avatar::SMALL);
?>
                            </a>
                        </td>
                        <td>
                            <a href="<?php 
echo URLHelper::getLink('dispatch.php/profile?username='******'username']);
?>
">
                                <?php 
echo htmlReady($p['fullname']);
?>
                            </a>
                        </td>
                        <td class="actions">
                            <a href="<?php 
 public function pushDataToIndexServers($delete = false)
 {
     $myHost = LernmarktplatzHost::thisOne();
     $data = array();
     $data['host'] = array('name' => $myHost['name'], 'url' => $myHost['url'], 'public_key' => $myHost['public_key']);
     $data['data'] = $this->toArray();
     $data['data']['foreign_material_id'] = $data['data']['material_id'];
     unset($data['data']['material_id']);
     unset($data['data']['id']);
     unset($data['data']['user_id']);
     unset($data['data']['host_id']);
     $user_description_datafield = DataField::find(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")) ?: DataField::findOneBySQL("name = ?", array(get_config("LERNMARKTPLATZ_USER_DESCRIPTION_DATAFIELD")));
     if ($user_description_datafield) {
         $datafield_entry = DatafieldEntryModel::findOneBySQL("range_id = ? AND datafield_id = ?", array($this['user_id'], $user_description_datafield->getId()));
     }
     $data['user'] = array('user_id' => $this['user_id'], 'name' => get_fullname($this['user_id']), 'avatar' => Avatar::getAvatar($this['user_id'])->getURL(Avatar::NORMAL), 'description' => $datafield_entry ? $datafield_entry['content'] : null);
     $data['topics'] = array();
     foreach ($this->getTopics() as $tag) {
         if ($tag['name']) {
             $data['topics'][] = $tag['name'];
         }
     }
     if ($delete) {
         $data['delete_material'] = 1;
     }
     foreach (LernmarktplatzHost::findBySQL("index_server = '1' AND allowed_as_index_server = '1' ") as $index_server) {
         if (!$index_server->isMe()) {
             echo " push ";
             $index_server->pushDataToEndpoint("push_data", $data);
         }
     }
 }
    <form action="<?php 
echo $controller->url_for('oauth/authorize?oauth_token=' . $rs['token']);
?>
" method="post">
        <p>
            <?php 
echo Studip\Button::createAccept('erlauben', 'allow');
?>
            <?php 
echo Studip\LinkButton::createCancel('verweigern', $rs['callback_url']);
?>
        </p>
    </form>

    <p>
        <?php 
echo Avatar::getAvatar($GLOBALS['user']->id)->getImageTag(Avatar::SMALL);
?>

        <?php 
echo sprintf(_('Angemeldet als <strong>%s</strong> (%s)'), $name = get_fullname(), $GLOBALS['user']->username);
?>
<br>
        <small>
            <?php 
echo sprintf(_('Sind sie nicht <strong>%s</strong>, so <a href="%s">melden Sie sich bitte ab</a> und versuchen es erneut.'), $name, URLHelper::getLink('logout.php'));
?>
        </small>
    </p>
</section>
Beispiel #14
0
        <tr>
            <td><strong><?php 
echo _("Durchführende Dozenten");
?>
</strong></td>
            <td>
                <? $dozenten = $date->dozenten ?>
                <? count($dozenten) > 0 || $dozenten = array_map(function ($m) { return $m->user; }, (Course::findCurrent()->getMembersWithStatus("dozent"))) ?>
                <ul class="dozenten_list clean">
                <? foreach ($dozenten as $dozent) : ?>
                    <li>
                        <a href="<?php 
echo URLHelper::getLink("dispatch.php/profile", array('username' => $dozent['username']));
?>
"><?php 
echo Avatar::getAvatar($dozent['user_id'])->getImageTag(Avatar::SMALL) . " " . htmlReady($dozent->getFullName());
?>
</a>
                    </li>
                <? endforeach ?>
                </ul>
            </td>
        </tr>
        <tr>
            <td><strong><?php 
echo _("Beteiligte Gruppen");
?>
</strong></td>
            <td>
                <? $groups = $date->statusgruppen ?>
                <? if (count($groups)) : ?>
Beispiel #15
0
</updated>
        <content><?php 
echo htmlReady(studip_utf8encode($posting['description']));
?>
</content>
        <activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
        <author>
            <name><?php 
echo htmlReady(studip_utf8encode($posting['user_id']));
?>
</name>
            <uri><?php 
echo $GLOBALS['ABSOLUTE_URI_STUDIP'] . "/about.php?username="******"alternate" type="text/html" href="<?php 
echo $GLOBALS['ABSOLUTE_URI_STUDIP'] . "/about.php?username="******"/>
            <link rel="avatar" type="image/png" media:width="200" media:height="250" href="<?php 
echo Avatar::getAvatar($posting['user_id'])->getURL(Avatar::NORMAL);
?>
"/>
        </author>
        <link rel="ostatus:conversation" href="<?php 
echo $GLOBALS['ABSOLUTE_URI_STUDIP'] . "/plugins.php/Blubber/forum/thread/" . $posting['root_id'];
?>
"/>
    </entry>
    <? endforeach ?>
</feed>
Beispiel #16
0
    <? foreach ($users as $user) : ?>
    <tr>
        <td style="white-space:nowrap;">
            <input class="check_all" type="checkbox" name="user_ids[]" value="<?php 
echo $user['user_id'];
?>
">
            <a href="<?php 
echo URLHelper::getLink('dispatch.php/profile', array('username' => $user['username']));
?>
" title="<?php 
echo _('Profil des Benutzers anzeigen');
?>
">
                 <?php 
echo Avatar::getAvatar($user['user_id'], $user['username'])->getImageTag(Avatar::SMALL, array('title' => htmlReady($user['Vorname'] . ' ' . $user['Nachname'])));
?>
            </a>
        </td>
        <td>
            <a href="<?php 
echo URLHelper::getLink('dispatch.php/profile', array('username' => $user['username']));
?>
" title="<?php 
echo _('Profil des Benutzers anzeigen');
?>
">
                <?php 
echo $user['username'];
?>
            </a>
Beispiel #17
0
?>
            <? if ($material['host_id'] || $material['user_id'] !== $GLOBALS['user']->id) : ?>
                </a>
            <? endif ?>
        <? endif ?>
    </div>

    <ul class="reviews">
        <? foreach ($material->reviews as $review) : ?>
            <li id="review_<?php 
echo $review->getId();
?>
" class="review">
                <div class="avatar">
                    <img width="50px" height="50px" src="<?php 
echo htmlReady($review['host_id'] ? LernmarktplatzUser::find($review['user_id'])->avatar : Avatar::getAvatar($review['user_id'])->getURL(Avatar::MEDIUM));
?>
">
                </div>
                <div class="content">
                    <div class="timestamp">
                        <a href="<?php 
echo PluginEngine::getLink($plugin, array(), "market/discussion/" . $review->getId());
?>
" title="<?php 
echo _("Schreiben Sie einen Kommentar dazu.");
?>
">
                            <?php 
echo Icon::create("comment", "inactive")->asImg(14, array('class' => "text-bottom"));
?>
Beispiel #18
0
 public function comment_action()
 {
     $context = Request::option("context");
     $thread = new ForumPosting(Request::option("thread"));
     if ($thread['context_type'] === "course") {
         $seminar = new Seminar($context);
         if ($seminar->write_level > 0 && !$GLOBALS['perm']->have_studip_perm("autor", $context)) {
             throw new AccessDeniedException("Kein Zugriff");
         }
     }
     ForumPosting::$course_hashes = $thread['context_type'] === "course" ? $thread['Seminar_id'] : false;
     if (Request::option("thread") && $thread['Seminar_id'] === $context) {
         $output = array();
         $posting = new ForumPosting();
         ForumPosting::$mention_thread_id = $thread->getId();
         StudipTransformFormat::addStudipMarkup("mention1", '@\\"[^\\n\\"]*\\"', "", "ForumPosting::mention");
         StudipTransformFormat::addStudipMarkup("mention2", '@[^\\s]*[\\d\\w_]+', "", "ForumPosting::mention");
         $content = transformBeforeSave(studip_utf8decode(Request::get("content")));
         //mentions einbauen:
         $content = preg_replace("/(@\"[^\n\"]*\")/e", "ForumPosting::mention('\\1', '" . $thread->getId() . "')", $content);
         $content = preg_replace("/(@[^\\s]+)/e", "ForumPosting::mention('\\1', '" . $thread->getId() . "')", $content);
         $posting['description'] = $content;
         $posting['context_type'] = $thread['context_type'];
         $posting['seminar_id'] = $thread['Seminar_id'];
         $posting['root_id'] = $posting['parent_id'] = Request::option("thread");
         $posting['name'] = "Re: " . $thread['name'];
         if ($GLOBALS['user']->id !== "nobody") {
             $posting['user_id'] = $GLOBALS['user']->id;
             $posting['author'] = get_fullname();
         } else {
             if (Request::get("anonymous_security") === $_SESSION['blubber_anonymous_security']) {
                 $contact_user = BlubberExternalContact::findByEmail(Request::get("anonymous_email"));
                 $_SESSION['anonymous_email'] = Request::get("anonymous_email");
                 $_SESSION['anonymous_name'] = $contact_user['name'] = Request::get("anonymous_name");
                 $contact_user->store();
                 $posting['user_id'] = $contact_user->getId();
                 $posting['external_contact'] = 1;
                 $posting['author'] = Request::get("anonymous_name");
             } else {
                 throw new AccessDeniedException("No permission to write posting.");
             }
         }
         $posting['author_host'] = $_SERVER['REMOTE_ADDR'];
         if ($posting->store()) {
             $factory = new Flexi_TemplateFactory($this->plugin->getPluginPath() . "/views/forum");
             $template = $factory->open("comment.php");
             $template->set_attribute('posting', $posting);
             $template->set_attribute('course_id', $thread['Seminar_id']);
             $output['content'] = studip_utf8encode($template->render($template->render()));
             $output['mkdate'] = time();
             $output['posting_id'] = $posting->getId();
             //Notifications:
             if (class_exists("PersonalNotifications")) {
                 $user_ids = array();
                 if ($thread['user_id'] && $thread['user_id'] !== $GLOBALS['user']->id) {
                     $user_ids[] = $thread['user_id'];
                 }
                 foreach ((array) $thread->getChildren() as $comment) {
                     if ($comment['user_id'] && $comment['user_id'] !== $GLOBALS['user']->id && !$comment['external_contact']) {
                         $user_ids[] = $comment['user_id'];
                     }
                 }
                 $user_ids = array_unique($user_ids);
                 PersonalNotifications::add($user_ids, PluginEngine::getURL($this->plugin, array('cid' => $thread['context_type'] === "course" ? $thread['Seminar_id'] : null), "forum/thread/" . $thread->getId()), get_fullname() . " hat einen Kommentar geschrieben", "posting_" . $posting->getId(), Avatar::getAvatar($GLOBALS['user']->id)->getURL(Avatar::MEDIUM));
             }
         }
         $this->render_json($output);
     } else {
         $this->render_json(array('error' => "Konnte thread nicht zuordnen."));
     }
 }
Beispiel #19
0
                    <td colspan="4" style="text-align: center">
                        <?php 
echo _('Keine TutorInnen eingetragen');
?>
                    </td>
                </tr>
        <? else: ?>
            <? foreach ($tutoren as $num => $tutor): ?>
                <tr>
                    <td>
                        <a href="<?php 
echo URLHelper::getLink('dispatch.php/profile?username='******'username']);
?>
">
                            <?php 
echo Avatar::getAvatar($tutor['user_id'], $tutor['username'])->getImageTag(Avatar::SMALL);
?>
                        </a>
                    </td>
                    <td>
                        <?php 
echo get_fullname($tutor['user_id'], 'full_rev', true) . ' (' . $tutor['username'] . ')';
?>
                    </td>
                    <td>
                    <? if ($perm_dozent && !$tutor_is_locked): ?>
                        <input value="<?php 
echo htmlReady($tutor['label']);
?>
" type="text" name="label[<?php 
echo htmlReady($tutor['user_id']);
Beispiel #20
0
                <th><?php 
echo _('Aktion');
?>
</th>
            </tr>
            </thead>

            <tbody>

            <? if (count($selectPerms) > 0): ?>
                <? $i = 0;
                foreach ($selectPerms as $user_id => $perm): ?>
                    <tr>
                        <td>
                            <?php 
echo Avatar::getAvatar($user_id)->getImageTag(Avatar::SMALL, array('style' => 'margin-right: 5px', 'title' => htmlReady($resObject->getOwnerName(true, $user_id))));
?>
                        </td>
                        <td>
                            <input type="hidden" name="change_user_id[]" value="<?php 
echo $user_id;
?>
">
                            <a href="<?php 
echo $resObject->getOwnerLink($user_id);
?>
">
                                <?php 
echo htmlReady($resObject->getOwnerName(true, $user_id));
?>
                            </a>
 public function indexing_action()
 {
     if (!$GLOBALS['perm']->have_perm("root")) {
         throw new AccessDeniedException("Kein Zugriff");
     }
     //indexiert Veranstaltungen:
     $db = DBManager::get();
     $count = 0;
     $seminare = $db->query("SELECT * FROM seminare " . "");
     $index = Globalsearch::get();
     while ($seminar = $seminare->fetch(PDO::FETCH_ASSOC)) {
         $searchtext = $seminar['VeranstaltungsNummer'] . " " . $seminar['Name'] . " " . $seminar['Untertitel'] . " " . $seminar['Beschreibung'] . " " . $seminar['Sonstiges'] . " " . $seminar['Ort'];
         $sem_tree_ids = $db->query("SELECT sem_tree_id FROM seminar_sem_tree WHERE seminar_id = " . $db->quote($seminar['Seminar_id']))->fetchAll(PDO::FETCH_COLUMN, 0);
         $searchtext .= GlobalSearchPlugin::getStudyareaSearchstring($sem_tree_ids);
         $index->setEntry($seminar['Name'], "seminar", "details.php?cid=" . $seminar['Seminar_id'], $seminar['visible'] ? null : $seminar['Seminar_id'], $searchtext, CourseAvatar::getAvatar($seminar['Seminar_id'])->getImageTag(Avatar::SMALL) . " " . htmlReady($seminar['Name']), $seminar['Seminar_id']);
         $count++;
     }
     $users = $db->query("SELECT * FROM auth_user_md5 " . "");
     while ($user = $users->fetch(PDO::FETCH_ASSOC)) {
         $searchtext = $user['Vorname'] . " " . $user['Nachname'];
         $index->setEntry($user['Vorname'] . " " . $user['Nachname'], "user", "about.php?username="******"never" ? null : $user['user_id'], $searchtext, Avatar::getAvatar($user['user_id'])->getImageTag(Avatar::SMALL) . " " . htmlReady($user['Vorname']) . " " . htmlReady($user['Nachname']), $user['user_id']);
         $count++;
     }
     $documents = $db->query("SELECT * FROM dokumente " . "");
     while ($document = $documents->fetch(PDO::FETCH_ASSOC)) {
         $seminar_name = $db->query("SELECT Name FROM seminare WHERE Seminar_id = " . $db->quote($document['seminar_id']) . " ")->fetch(PDO::FETCH_COLUMN, 0);
         $searchtext = $document['name'] . " " . $document['description'] . " " . $document['filename'];
         $sem_tree_ids = $db->query("SELECT sem_tree_id FROM seminar_sem_tree WHERE seminar_id = " . $db->quote($document['seminar_id']))->fetchAll(PDO::FETCH_COLUMN, 0);
         $searchtext .= GlobalSearchPlugin::getStudyareaSearchstring($sem_tree_ids);
         $index->setEntry($document['name'] . ($seminar_name ? " in " . $seminar_name : ""), "document", "folder.php?cid=" . $document['seminar_id'] . "&cmd=all&open=" . $document['dokument_id'] . "#anker", $document['seminar_id'], $searchtext, "<strong>" . htmlReady($document['filename']) . "</strong>: " . htmlReady($document['description']), $document['dokument_id']);
         $count++;
     }
     $resources = $db->query("SELECT * FROM resources_objects WHERE category_id != '' " . "");
     while ($object = $resources->fetch(PDO::FETCH_ASSOC)) {
         $index->setEntry($object['name'], "resource", "resources.php?show_object=" . $object['resource_id'] . "&view=view_schedule", null, $object['name'] . " " . $object['description'], htmlReady($object['description']), $object['resource_id']);
         $count++;
     }
     $postings = $db->query("SELECT * FROM px_topics ");
     while ($posting = $postings->fetchAll(PDO::FETCH_ASSOC)) {
         $posting_content = preg_replace("/\\[quote([=\\d\\w\\s]*)\\]([\\d\\w\\s]*)\\[\\/quote\\]/", "", $posting['description']);
         $posting_content = strip_tags(formatReady(str_replace("\n", " ", $posting_content)));
         $searchtext = get_fullname($posting['user_id']) . " " . $posting_content;
         $sem_tree_ids = $db->query("SELECT sem_tree_id FROM seminar_sem_tree WHERE seminar_id = " . $db->quote($posting['Seminar_id']))->fetchAll(PDO::FETCH_COLUMN, 0);
         $searchtext .= GlobalSearchPlugin::getStudyareaSearchstring($sem_tree_ids);
         $index->setEntry($posting['name'], "posting", "forum.php?cid=" . $posting['Seminar_id'] . "&view=tree&open=" . $posting['topic_id'] . "#anker", $posting['Seminar_id'], $searchtext, $posting_content, $posting['topic_id']);
         $count++;
     }
     $result_object = new stdClass();
     $result_object->count = 0;
     NotificationCenter::postNotification("indexing_plugin_items", $result_object);
     $count += $result_object->count;
     if ($GLOBALS['IS_CLI']) {
         echo "Index ersellt mit " . $count . " Einträgen.";
     } else {
         $template = $this->getTemplate("indexing.php");
         $template->set_attribute("count", $count);
         $template->set_attribute("plugin", $this);
         echo $template->render();
     }
 }
Beispiel #22
0
<? if (!Request::isXhr()) : ?>
    <h1><?php 
echo _("Betreff") . ": " . htmlReady($message["subject"]);
?>
</h1>
<? endif ?>

<? if ($message["autor_id"] !== "____%system%____") : ?>
<div style="float:left; margin-right: 10px;"><?php 
echo Avatar::getAvatar($message["autor_id"])->getImageTag(Avatar::MEDIUM);
?>
</div>
<? endif ?>
<table id="message_metadata" data-message_id="<?php 
echo $message->getId();
?>
">
    <tbody>
        <tr>
            <td><strong><?php 
echo _("Von");
?>
</strong></td>
            <td>
            <? if ($message['autor_id'] === '____%system%____'): ?>
                <?php 
echo _('Stud.IP');
?>
            <? else: ?>
                <a href="<?php 
echo URLHelper::getLink("dispatch.php/profile", array('username' => get_username($message["autor_id"])));
Beispiel #23
0
 /**
  * Returns an instance of Avatar for the user.
  * @return Avatar
  */
 public function getAvatar()
 {
     return Avatar::getAvatar($this->getId());
 }
Beispiel #24
0
 /**
  * Merge an user ($old_id) to another user ($new_id).  This is a part of the
  * old numit-plugin.
  *
  * @param string $old_user
  * @param string $new_user
  * @param boolean $identity merge identity (if true)
  *
  * @return array() messages to display after migration
  */
 public static function convert($old_id, $new_id, $identity = false)
 {
     NotificationCenter::postNotification('UserWillMigrate', $old_id, $new_id);
     $messages = array();
     //Identitätsrelevante Daten migrieren
     if ($identity) {
         // Veranstaltungseintragungen
         self::removeDoubles('seminar_user', 'Seminar_id', $new_id, $old_id);
         $query = "UPDATE IGNORE seminar_user SET user_id = ? WHERE user_id = ?";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($new_id, $old_id));
         self::removeDoubles('admission_seminar_user', 'seminar_id', $new_id, $old_id);
         $query = "UPDATE IGNORE admission_seminar_user SET user_id = ? WHERE user_id = ?";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($new_id, $old_id));
         // Persönliche Infos
         $query = "DELETE FROM user_info WHERE user_id = ?";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($new_id));
         $query = "UPDATE IGNORE user_info SET user_id = ? WHERE user_id = ?";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($new_id, $old_id));
         // Studiengänge
         self::removeDoubles('user_studiengang', 'studiengang_id', $new_id, $old_id);
         $query = "UPDATE IGNORE user_studiengang SET user_id = ? WHERE user_id = ?";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($new_id, $old_id));
         // Eigene Kategorien
         $query = "UPDATE IGNORE kategorien SET range_id = ? WHERE range_id = ?";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($new_id, $old_id));
         // Institute
         self::removeDoubles('user_inst', 'Institut_id', $new_id, $old_id);
         $query = "UPDATE IGNORE user_inst SET user_id = ? WHERE user_id = ?";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($new_id, $old_id));
         // Generische Datenfelder zusammenführen (bestehende Einträge des
         // "neuen" Nutzers werden dabei nicht überschrieben)
         $old_user = User::find($old_id);
         $query = "INSERT INTO datafields_entries\n                        (datafield_id, range_id, sec_range_id, content, mkdate, chdate)\n                      VALUES (:datafield_id, :range_id, :sec_range_id, :content,\n                              UNIX_TIMESTAMP(), UNIX_TIMESTAMP())\n                      ON DUPLICATE KEY\n                        UPDATE content = IF(content IN ('', 'default_value'), VALUES(content), content),\n                               chdate = UNIX_TIMESTAMP()";
         $statement = DBManager::get()->prepare($query);
         $statement->bindValue(':range_id', $new_id);
         $old_user->datafields->each(function ($field) use($new_id, $statement) {
             $statement->bindValue(':datafield_id', $field->datafield_id);
             $statement->bindValue(':sec_range_id', $field->sec_range_id);
             $statement->bindValue(':content', $field->content);
             $statement->execute();
         });
         # Datenfelder des alten Nutzers leeren
         $old_user->datafields = array();
         $old_user->store();
         //Buddys
         $query = "UPDATE IGNORE contact SET owner_id = ? WHERE owner_id = ?";
         $statement = DBManager::get()->prepare($query);
         $statement->execute(array($new_id, $old_id));
         // Avatar
         $old_avatar = Avatar::getAvatar($old_id);
         $new_avatar = Avatar::getAvatar($new_id);
         if ($old_avatar->is_customized()) {
             if (!$new_avatar->is_customized()) {
                 $avatar_file = $old_avatar->getFilename(AVATAR::ORIGINAL);
                 if (!file_exists($avatar_file)) {
                     $avatar_file = $old_avatar->getFilename(AVATAR::NORMAL);
                 }
                 $new_avatar->createFrom($avatar_file);
             }
             $old_avatar->reset();
         }
         $messages[] = _('Identitätsrelevante Daten wurden migriert.');
     }
     // Restliche Daten übertragen
     // ForumsModule migrieren
     foreach (PluginEngine::getPlugins('ForumModule') as $plugin) {
         $plugin->migrateUser($old_id, $new_id);
     }
     // Dateieintragungen und Ordner
     // TODO (mlunzena) should post a notification
     $query = "UPDATE IGNORE dokumente SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE folder SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     //Kalender
     $query = "UPDATE IGNORE calendar_event SET range_id = ? WHERE range_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE calendar_user SET owner_id = ? WHERE owner_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE calendar_user SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE event_data SET author_id = ? WHERE author_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE event_data SET editor_id = ? WHERE editor_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     //Archiv
     self::removeDoubles('archiv_user', 'seminar_id', $new_id, $old_id);
     $query = "UPDATE IGNORE archiv_user SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     // Evaluationen
     $query = "UPDATE IGNORE eval SET author_id = ? WHERE author_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     self::removeDoubles('eval_user', 'eval_id', $new_id, $old_id);
     $query = "UPDATE IGNORE eval_user SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE evalanswer_user SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     // Kategorien
     $query = "UPDATE IGNORE kategorien SET range_id = ? WHERE range_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     // Literatur
     $query = "UPDATE IGNORE lit_catalog SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE lit_list SET range_id = ? WHERE range_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     // Nachrichten (Interne)
     $query = "UPDATE IGNORE message SET autor_id = ? WHERE autor_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     self::removeDoubles('message_user', 'message_id', $new_id, $old_id);
     $query = "UPDATE IGNORE message_user SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     // News
     $query = "UPDATE IGNORE news SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE news_range SET range_id = ? WHERE range_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     // Informationsseiten
     $query = "UPDATE IGNORE scm SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     // Statusgruppeneinträge
     self::removeDoubles('statusgruppe_user', 'statusgruppe_id', $new_id, $old_id);
     $query = "UPDATE IGNORE statusgruppe_user SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     // Termine
     $query = "UPDATE IGNORE termine SET autor_id = ? WHERE autor_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     //Votings
     $query = "UPDATE IGNORE vote SET author_id = ? WHERE author_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE vote SET range_id = ? WHERE range_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     self::removeDoubles('vote_user', 'vote_id', $new_id, $old_id);
     $query = "UPDATE IGNORE vote_user SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     self::removeDoubles('voteanswers_user', 'answer_id', $new_id, $old_id);
     $query = "UPDATE IGNORE voteanswers_user SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     //Wiki
     $query = "UPDATE IGNORE wiki SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE wiki_locks SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     //Adressbucheinträge
     $query = "UPDATE IGNORE contact SET owner_id = ? WHERE owner_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     //Blubber
     $query = "UPDATE IGNORE blubber SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE blubber_follower SET studip_user_id = ? WHERE studip_user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE blubber_mentions SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE blubber_reshares SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     $query = "UPDATE IGNORE blubber_streams SET user_id = ? WHERE user_id = ?";
     $statement = DBManager::get()->prepare($query);
     $statement->execute(array($new_id, $old_id));
     NotificationCenter::postNotification('UserDidMigrate', $old_id, $new_id);
     $messages[] = _('Dateien, Termine, Adressbuch, Nachrichten und weitere Daten wurden migriert.');
     return $messages;
 }
Beispiel #25
0
?>
/<?php 
echo $countAnswers;
?>
)
            </td>
            <td width="50%">
                <? if (!$vote->questionnaire['anonymous'] && $results[$key]) : ?>
                <? foreach ($results_users[$key] as $index => $user_id) : ?>
                    <? if ($user_id && $user_id !== "nobody") : ?>
                        <a href="<?php 
echo URLHelper::getLink("dispatch.php/profile", array('username' => get_username($user_id)));
?>
">
                            <?php 
echo Avatar::getAvatar($user_id, get_username($user_id))->getImageTag(Avatar::SMALL, array('title' => htmlReady(get_fullname($user_id))));
?>
                            <? if (count($results_users[$key]) < 4) : ?>
                                <?php 
echo htmlReady(get_fullname($user_id));
?>
                            <? endif ?>
                        </a>
                    <? endif ?>
                <? endforeach ?>
            <? endif ?>
            </td>
        </tr>
    <? endforeach ?>
    </tbody>
</table>
Beispiel #26
0
 function show_action($id = NULL, $size = Avatar::SMALL)
 {
     $this->redirect(Avatar::getAvatar($id)->getURL($size));
 }
Beispiel #27
0
 /**
  * Prevents the avatar of invisible users from being displayed
  *
  * @return mixed Useravatar if visible else dummyavatar
  */
 public function avatar()
 {
     return Avatar::getAvatar($this->user_id, $this->user->username)->getImageTag(Avatar::SMALL, array('title' => htmlReady($this->name())));
 }
Beispiel #28
0
                <td colspan="3">
                    <?php 
echo _('Niemand ist in die Liste eingetragen.');
?>
                </td>
            </tr>
        <? else: $i = 1; ?>
            <? foreach ($users as $u) : ?>
                <tr>
                    <td>
                        <a href="<?php 
echo URLHelper::getLink('dispatch.php/profile?username='******'dispatch.php/profile?username='******'full_rev') . ' (' . $u->username . ')';
?>
                        </a>
                        <input type="hidden" name="users[]" value="<?php 
echo $u->id;
?>
Beispiel #29
0
 private function membersToJSON($course, $members)
 {
     $json = array();
     foreach ($members as $member) {
         $url = $this->urlf('/user/%s', array($member->user_id));
         $avatar = \Avatar::getAvatar($member->user_id);
         $json[$url] = array('member' => User::getMiniUser($this, $member->user), 'status' => $member->status);
     }
     return $json;
 }
Beispiel #30
0
echo htmlReady($person->getFullName('full_rev'));
?>
 -- <?php 
echo htmlReady($person->perms);
?>
 (<?php 
echo htmlReady($person->username);
?>
)</option>
        <? endforeach; ?>
        <? foreach ($defaultSelectedUsers as $person): ?>
            <option value="<?php 
echo $person->id;
?>
" selected><?php 
echo Avatar::getAvatar($person->id)->getURL(Avatar::MEDIUM);
?>
 -- <?php 
echo htmlReady($person->getFullName('full_rev'));
?>
 -- <?php 
echo htmlReady($person->perms);
?>
 (<?php 
echo htmlReady($person->username);
?>
)</option>
        <? endforeach; ?>
    </select>

    <?php