function user_edit_vouchers_controller()
{
    global $privileges, $user;
    if (isset($_REQUEST['user_id'])) {
        $user_source = User($_REQUEST['user_id']);
    } else {
        $user_source = $user;
    }
    if (!in_array('admin_user', $privileges)) {
        redirect(page_link_to(''));
    }
    if (isset($_REQUEST['submit'])) {
        $ok = true;
        if (isset($_REQUEST['vouchers']) && test_request_int('vouchers') && trim($_REQUEST['vouchers']) >= 0) {
            $vouchers = trim($_REQUEST['vouchers']);
        } else {
            $ok = false;
            error(_("Please enter a valid number of vouchers."));
        }
        if ($ok) {
            $user_source['got_voucher'] = $vouchers;
            $result = User_update($user_source);
            if ($result === false) {
                engelsystem_error('Unable to update user.');
            }
            success(_("Saved the number of vouchers."));
            engelsystem_log(User_Nick_render($user_source) . ': ' . sprintf("Got %s vouchers", $user_source['got_voucher']));
            redirect(user_link($user_source));
        }
    }
    return array(sprintf(_("%s's vouchers"), $user_source['Nick']), User_edit_vouchers_view($user_source));
}
/**
 * Edit a user's driving license information.
 * @param User $user_source
 * @param bool $wants_to_drive
 * @param bool $has_car
 * @param bool $has_license_car
 * @param bool $has_license_3_5t_transporter
 * @param bool $has_license_7_5t_truck
 * @param bool $has_license_12_5t_truck
 * @param bool $has_license_forklift
 */
function UserDriverLicense_edit_view($user_source, $wants_to_drive, $has_car, $has_license_car, $has_license_3_5t_transporter, $has_license_7_5t_truck, $has_license_12_5t_truck, $has_license_forklift)
{
    return page_with_title(sprintf(_("Edit %s driving license information"), User_Nick_render($user_source)), [buttons([button(user_link($user_source), _("Back to profile"), 'back')]), msg(), form([form_info(_("Privacy"), _("Your driving license information is only visible for coordinators and admins.")), form_checkbox('wants_to_drive', _("I am willing to operate cars for the PL"), $wants_to_drive), div('panel panel-default', [div('panel-body', [form_checkbox('has_car', _("I have my own car with me and am willing to use it for the PL (You'll get reimbursed for fuel)"), $has_car), heading(_("Driver license"), 3), form_checkbox('has_license_car', _("Car"), $has_license_car), form_checkbox('has_license_3_5t_transporter', _("Transporter 3,5t"), $has_license_3_5t_transporter), form_checkbox('has_license_7_5t_truck', _("Truck 7,5t"), $has_license_7_5t_truck), form_checkbox('has_license_12_5t_truck', _("Truck 12,5t"), $has_license_12_5t_truck), form_checkbox('has_license_forklift', _("Forklift"), $has_license_forklift)])], 'driving_license'), form_submit('submit', _("Save"))]), '<script type="text/javascript">
        $(function() {
          if($("#wants_to_drive").is(":checked"))
            $("#driving_license").show();
          else
            $("#driving_license").hide();
        
          $("#wants_to_drive").click(
            function(e) {
              if($("#wants_to_drive").is(":checked"))
                $("#driving_license").show();
              else
                $("#driving_license").hide();
            }
          );
        });
      </script>']);
}
function user_got_voucher_controller()
{
    global $privileges, $user;
    if (isset($_REQUEST['user_id'])) {
        $user_source = User($_REQUEST['user_id']);
    } else {
        $user_source = $user;
    }
    $admin_user_privilege = in_array('admin_user', $privileges);
    if (!in_array('admin_user', $privileges)) {
        redirect(page_link_to(''));
    }
    if (!isset($_REQUEST['got_voucher'])) {
        redirect(page_link_to(''));
    }
    $user_source['got_voucher'] = $_REQUEST['got_voucher'] == 'true';
    $result = User_update($user_source);
    if ($result === false) {
        engelsystem_error('Unable to update user.');
    }
    success($user_source['got_voucher'] ? _('User got vouchers.') : _('User didnt got vouchers.'));
    engelsystem_log(User_Nick_render($user_source) . ($user_source['got_voucher'] ? ' got vouchers' : ' didnt got vouchers'));
    redirect(user_link($user_source));
}
Exemple #4
0
<?php

slot('header_text', $network['name']);
slot('header_link', LsListTable::getNetworkInternalUrl($network));
?>

<?php 
include_partial('global/section', array('title' => 'Analysts in this Network', 'pager' => $user_pager));
?>

<div class="padded">
<?php 
foreach ($user_pager->execute() as $user) {
    ?>
  <div style="float: left; padding: .6em; height: 5em; text-align: center;">
    <?php 
    echo user_pic($user);
    ?>
 
    <br />
    <span class="text_small"><?php 
    echo user_link($user);
    ?>
</span>
  </div>
<?php 
}
?>
</div>
 
 <? $author = CI::model('users')->getUserById( $data); ?>
    <? $thumb = CI::model('users')->getUserThumbnail( $author['id'], 70); ?>

 <li> 
 
 
 
 
 <a href="<? print user_link($author['id']); ?>"> <span style="background-image: url('<?  print $thumb; ?>');"></span> <strong><?  print user_name($author['id']) ; ?></strong> </a> </li>
Exemple #6
0
   | Authors: Martin Jansen <*****@*****.**>                                  |
   +----------------------------------------------------------------------+
   $Id$
*/
response_header('Announcing the PEAR Group');
?>

<h1>Announcing the PEAR Group</h1>

[August 20, 2003]

<div id="news-entry">

<p>
 On 12th August 2003 <?php 
echo user_link('ssb', true);
?>
, the founder of PEAR, announced
 the forming of the PEAR Group, which will be the governing body of
 PEAR. The full announcement can be
<?php 
echo make_link('http://marc.theaimsgroup.com/?l=pear-dev&m=106073080219083&w=2', 'found here');
?>
.
</p>

<p>
 More information about the Group, including a first administrative
 document, can be found at a <?php 
echo make_link("/group/", "dedicated place");
?>
Exemple #7
0
 function sendActionEmail($event, $userType, $user_handle = null, $comment = '')
 {
     global $dbh, $karma, $auth_user;
     if (empty($karma)) {
         $karma = new Damblan_Karma($dbh);
     }
     require 'pepr/pepr-emails.php';
     $email = $proposalEmailTexts[$event];
     if (empty($email)) {
         return PEAR::raiseError("Email template for {$event} not found");
     }
     switch ($userType) {
         case 'admin':
             $prefix = "[ADMIN]";
             break;
         case 'mixed':
             if ($karma->has($user_handle, "pear.pepr.admin") && $this->user_handle != $user_handle) {
                 $prefix = "[ADMIN]";
             } else {
                 $prefix = "";
             }
             break;
         default:
             $prefix = "";
     }
     $prefix = PROPOSAL_EMAIL_PREFIX . $prefix . " ";
     include_once 'pear-database-user.php';
     $actorinfo = user::info($user_handle);
     $ownerinfo = user::info($this->user_handle);
     $this->getVotes($dbh);
     $vote = @$this->votes[$user_handle];
     if (isset($vote)) {
         $vote->value = $vote->value > 0 ? "+" . $vote->value : $vote->value;
         if ($vote->is_conditional) {
             $vote_conditional = "\n\nThis vote is conditional. The condition is:\n\n" . $vote->comment;
         } elseif ($vote->comment) {
             $comment = "\n\nComment:\n\n" . $vote->comment;
         }
         $vote_url = "http://" . PEAR_CHANNELNAME . "/pepr/pepr-vote-show.php?id=" . $this->id . "&handle=" . $user_handle;
     }
     if ($event == 'change_status_finished') {
         $proposalVotesSum = ppVote::getSum($dbh, $this->id);
         $vote_result = 'Sum of Votes: ' . $proposalVotesSum['all'];
         $vote_result .= ' (' . $proposalVotesSum['conditional'] . ' conditional)';
         if ($proposalVotesSum['all'] >= 5) {
             $vote_result .= "\nResult:       This proposal was accepted";
         } else {
             $vote_result .= "\nResult:       This proposal was rejected";
         }
     }
     $proposal_url = "http://" . PEAR_CHANNELNAME . "/pepr/pepr-proposal-show.php?id=" . $this->id;
     $end_voting_time = @$this->longened_date > 0 ? $this->longened_date + PROPOSAL_STATUS_VOTE_TIMELINE : @$this->vote_date + PROPOSAL_STATUS_VOTE_TIMELINE;
     if ($event == 'proposal_comment' && $user_handle == $this->user_handle) {
         $email['to'] = $email['to']['owner'];
     } else {
         if (!isset($user_handle)) {
             $email['to'] = $email['to']['pearweb'];
         } else {
             if ($karma->has($user_handle, "pear.pepr.admin")) {
                 $email['to'] = $email['to']['admin'];
             } else {
                 $email['to'] = $email['to']['user'];
             }
         }
     }
     $email['subject'] = $prefix . $email['subject'];
     $replace = array("/\\{pkg_category\\}/", "/\\{pkg_name\\}/", "/\\{owner_name\\}/", "/\\{owner_email\\}/", "/\\{owner_link\\}/", "/\\{actor_name\\}/", "/\\{actor_email\\}/", "/\\{actor_link\\}/", "/\\{proposal_url\\}/", "/\\{end_voting_time\\}/", "/\\{vote_value\\}/", "/\\{vote_url\\}/", "/\\{email_pear_dev\\}/", "/\\{email_pear_group\\}/", "/\\{comment\\}/", "/\\{vote_result\\}/", "/\\{vote_conditional\\}/");
     $replacements = array($this->pkg_category, $this->pkg_name, isset($ownerinfo['name']) ? $ownerinfo['name'] : "", isset($ownerinfo['email']) ? "<{$ownerinfo['email']}>" : '', isset($ownerinfo['handle']) ? user_link($ownerinfo['handle'], true) : "", isset($actorinfo['name']) ? $actorinfo['name'] : "", isset($actorinfo['email']) ? $actorinfo['email'] : "", isset($actorinfo['handle']) ? "http://" . PEAR_CHANNELNAME . "/user/" . $actorinfo['handle'] : "", $proposal_url, format_date($end_voting_time), isset($vote) ? $vote->value : 0, isset($vote) ? $vote_url : "", PROPOSAL_MAIL_PEAR_DEV, PROPOSAL_MAIL_PEAR_GROUP, isset($comment) ? wordwrap($comment) : '', isset($vote_result) ? $vote_result : '', isset($vote_conditional) ? $vote_conditional : "");
     $email = preg_replace($replace, $replacements, $email);
     $email['text'] .= PROPOSAL_EMAIL_POSTFIX;
     if (is_object($auth_user)) {
         $from = '"' . $auth_user->name . '" <' . $auth_user->email . '>';
     } else {
         $from = PROPOSAL_MAIL_FROM;
     }
     $to = explode(", ", $email['to']);
     $email['to'] = array_shift($to);
     $headers = "CC: " . implode(", ", $to) . "\n";
     $headers .= "From: " . $from . "\n";
     $headers .= "X-Mailer: " . "PEPr, PEAR Proposal System" . "\n";
     $headers .= "X-PEAR-Category: " . $this->pkg_category . "\n";
     $headers .= "X-PEAR-Package: " . $this->pkg_name . "\n";
     $headers .= "X-PEPr-Status: " . $this->getStatus() . "\n";
     if ($event == "change_status_proposal") {
         $headers .= "Message-ID: <proposal-" . $this->id . "@" . PEAR_CHANNELNAME . ">\n";
     } else {
         $headers .= "In-Reply-To: <proposal-" . $this->id . "@" . PEAR_CHANNELNAME . ">\n";
     }
     if (!DEVBOX) {
         $res = mail($email['to'], $email['subject'], $email['text'], $headers, '-f ' . PEAR_BOUNCE_EMAIL);
     } else {
         $res = true;
     }
     if (!$res) {
         return PEAR::raiseError('Could not send notification email.');
     }
     return true;
 }
Exemple #8
0
<tr>
  <td>
    <strong><?php 
echo link_to($object->getOneLiner(), 'entity/addressModifications?id=' . $object->id);
?>
</strong>
  </td>
  <td>
    <?php 
echo $object->created_at;
?>
 by <?php 
echo user_link($object->getCreatedByUser());
?>
  </td>
  <td>
    <?php 
echo time_ago_in_words(strtotime($object->updated_at));
?>
  </td>
  <td>
    <?php 
echo $object->is_deleted ? 'deteled' : 'active';
?>
  </td>
</td>
Exemple #9
0
    echo $__info['pic_hd_url'];
    ?>
">高清图</a>
			<?php 
}
if ($__info['pic_url'] != $__info['pic_hd_url']) {
    ?>
				<a class="label label-primary hidden-print" href="<?php 
    echo $__info['pic_url'];
    ?>
">原图</a>
			<?php 
}
?>
			<a class="visible-print glyphicon glyphicon-user" href="<?php 
echo user_link($__info['user_name']);
?>
"><?php 
echo $__info['user_aliases'];
?>
</a>
		</p>
	</div>
	<ul class="pager left">
		<?php 
if ($__info['previous_id'] < $__info['pic_id'] && $__info['previous_id'] != 0) {
    ?>
			<li class="previous">
				<a title="第 <?php 
    echo $__info['previous_id'];
    ?>
Exemple #10
0
function admin_arrive()
{
    $msg = "";
    $search = "";
    if (isset($_REQUEST['search'])) {
        $search = strip_request_item('search');
    }
    if (isset($_REQUEST['reset']) && preg_match("/^[0-9]*\$/", $_REQUEST['reset'])) {
        $id = $_REQUEST['reset'];
        $user_source = User($id);
        if ($user_source != null) {
            sql_query("UPDATE `User` SET `Gekommen`=0, `arrival_date` = NULL WHERE `UID`='" . sql_escape($id) . "' LIMIT 1");
            engelsystem_log("User set to not arrived: " . User_Nick_render($user_source));
            success(_("Reset done. Angel has not arrived."));
            redirect(user_link($user_source));
        } else {
            $msg = error(_("Angel not found."), true);
        }
    } elseif (isset($_REQUEST['arrived']) && preg_match("/^[0-9]*\$/", $_REQUEST['arrived'])) {
        $id = $_REQUEST['arrived'];
        $user_source = User($id);
        if ($user_source != null) {
            sql_query("UPDATE `User` SET `Gekommen`=1, `arrival_date`='" . time() . "' WHERE `UID`='" . sql_escape($id) . "' LIMIT 1");
            engelsystem_log("User set has arrived: " . User_Nick_render($user_source));
            success(_("Angel has been marked as arrived."));
            redirect(user_link($user_source));
        } else {
            $msg = error(_("Angel not found."), true);
        }
    }
    $users = sql_select("SELECT * FROM `User` ORDER BY `Nick`");
    $arrival_count_at_day = [];
    $planned_arrival_count_at_day = [];
    $planned_departure_count_at_day = [];
    $table = "";
    $users_matched = [];
    if ($search == "") {
        $tokens = [];
    } else {
        $tokens = explode(" ", $search);
    }
    foreach ($users as $usr) {
        if (count($tokens) > 0) {
            $match = false;
            $index = join(" ", $usr);
            foreach ($tokens as $t) {
                if (stristr($index, trim($t))) {
                    $match = true;
                    break;
                }
            }
            if (!$match) {
                continue;
            }
        }
        $usr['nick'] = User_Nick_render($usr);
        if ($usr['planned_departure_date'] != null) {
            $usr['rendered_planned_departure_date'] = date('Y-m-d', $usr['planned_departure_date']);
        } else {
            $usr['rendered_planned_departure_date'] = '-';
        }
        $usr['rendered_planned_arrival_date'] = date('Y-m-d', $usr['planned_arrival_date']);
        $usr['rendered_arrival_date'] = $usr['arrival_date'] > 0 ? date('Y-m-d', $usr['arrival_date']) : "-";
        $usr['arrived'] = $usr['Gekommen'] == 1 ? _("yes") : "";
        $usr['actions'] = $usr['Gekommen'] == 1 ? '<a href="' . page_link_to('admin_arrive') . '&reset=' . $usr['UID'] . '&search=' . $search . '">' . _("reset") . '</a>' : '<a href="' . page_link_to('admin_arrive') . '&arrived=' . $usr['UID'] . '&search=' . $search . '">' . _("arrived") . '</a>';
        if ($usr['arrival_date'] > 0) {
            $day = date('Y-m-d', $usr['arrival_date']);
            if (!isset($arrival_count_at_day[$day])) {
                $arrival_count_at_day[$day] = 0;
            }
            $arrival_count_at_day[$day]++;
        }
        if ($usr['planned_arrival_date'] != null) {
            $day = date('Y-m-d', $usr['planned_arrival_date']);
            if (!isset($planned_arrival_count_at_day[$day])) {
                $planned_arrival_count_at_day[$day] = 0;
            }
            $planned_arrival_count_at_day[$day]++;
        }
        if ($usr['planned_departure_date'] != null && $usr['Gekommen'] == 1) {
            $day = date('Y-m-d', $usr['planned_departure_date']);
            if (!isset($planned_departure_count_at_day[$day])) {
                $planned_departure_count_at_day[$day] = 0;
            }
            $planned_departure_count_at_day[$day]++;
        }
        $users_matched[] = $usr;
    }
    ksort($arrival_count_at_day);
    ksort($planned_arrival_count_at_day);
    ksort($planned_departure_count_at_day);
    $arrival_at_day = [];
    $arrival_sum = 0;
    foreach ($arrival_count_at_day as $day => $count) {
        $arrival_sum += $count;
        $arrival_at_day[$day] = ['day' => $day, 'count' => $count, 'sum' => $arrival_sum];
    }
    $planned_arrival_sum_at_day = [];
    $planned_arrival_sum = 0;
    foreach ($planned_arrival_count_at_day as $day => $count) {
        $planned_arrival_sum += $count;
        $planned_arrival_at_day[$day] = ['day' => $day, 'count' => $count, 'sum' => $planned_arrival_sum];
    }
    $planned_departure_at_day = [];
    $planned_departure_sum = 0;
    foreach ($planned_departure_count_at_day as $day => $count) {
        $planned_departure_sum += $count;
        $planned_departure_at_day[$day] = ['day' => $day, 'count' => $count, 'sum' => $planned_departure_sum];
    }
    return page_with_title(admin_arrive_title(), array(msg(), form(array(form_text('search', _("Search"), $search), form_submit('submit', _("Search")))), table(array('nick' => _("Nickname"), 'rendered_planned_arrival_date' => _("Planned arrival"), 'arrived' => _("Arrived?"), 'rendered_arrival_date' => _("Arrival date"), 'rendered_planned_departure_date' => _("Planned departure"), 'actions' => ""), $users_matched), div('row', [div('col-md-4', [heading(_("Planned arrival statistics"), 2), bargraph('planned_arrives', 'day', ['count' => _("arrived"), 'sum' => _("arrived sum")], ['count' => '#090', 'sum' => '#888'], $planned_arrival_at_day), table(['day' => _("Date"), 'count' => _("Count"), 'sum' => _("Sum")], $planned_arrival_at_day)]), div('col-md-4', [heading(_("Arrival statistics"), 2), bargraph('arrives', 'day', ['count' => _("arrived"), 'sum' => _("arrived sum")], ['count' => '#090', 'sum' => '#888'], $arrival_at_day), table(['day' => _("Date"), 'count' => _("Count"), 'sum' => _("Sum")], $arrival_at_day)]), div('col-md-4', [heading(_("Planned departure statistics"), 2), bargraph('planned_departures', 'day', ['count' => _("arrived"), 'sum' => _("arrived sum")], ['count' => '#090', 'sum' => '#888'], $planned_departure_at_day), table(['day' => _("Date"), 'count' => _("Count"), 'sum' => _("Sum")], $planned_departure_at_day)])])));
}
Exemple #11
0
?>
</li>
  <li><?php 
echo user_link('ssb');
?>
</li>
  <li><?php 
echo user_link('richard');
?>
</li>
  <li><?php 
echo user_link('cmv');
?>
</li>
  <li><?php 
echo user_link('toby');
?>
</li>
</ul>

<small>(In alphabetic order)</small>

<p>The website team can be reached at
<?php 
echo make_mailto_link(PEAR_WEBMASTER_EMAIL);
?>
.</p>

<p>More information about the website can be found on a
<a href="/about/">dedicated page</a>.</p>
Exemple #12
0
 * @var ULib\Comment $__comment
 */
?>
<div class="comment-msg">
	<div class="comment-head clearfix">
		<img class="img-rounded pull-left comment-avatar" alt="<?php 
echo $__comment->getUser()->getName();
?>
" src="<?php 
echo $__comment->getUser()->getAvatar();
?>
">

		<div class="pull-left">
			<p class="comment-info"><strong class="comment-aliases"><a href="<?php 
echo user_link($__comment->getUser()->getName());
?>
"><?php 
echo $__comment->getUser()->getAliases();
?>
</a></strong>
				<span class="comment-name"><?php 
echo $__comment->getUser()->getName();
?>
</span>
			</p>

			<p>
				<small class="comment-post-at">评论于:</small>
				<span class="comment-time"><?php 
echo convert_time($__comment->getCommentTime());
Exemple #13
0
<?php 
    include_partial('global/section', array('title' => "Who's Watching", 'action' => array('credential' => 'editor', 'text' => $sf_user->getGuardUser()->Profile->watching_opt_out ? 'opt in' : 'opt out', 'url' => 'home/editSettings')));
    ?>

<div class="padded" style="padding-bottom: .6em">
&nbsp;<br />&nbsp;
</div>

<?php 
    foreach ($watchers as $watcher) {
        ?>
  <div style = "float:left; padding: .6em; height: 5em">
  <span style="vertical-align:bottom">
  <?php 
        echo user_pic($watcher);
        ?>
 
  </span>
  <br />
  <span class="text_small" style="vertical-align:top">
  <?php 
        echo user_link($watcher, null, false);
        ?>
  </span>
  </div>
<?php 
    }
    ?>

<?php 
}
Exemple #14
0
for ($i = 3; $i < 10; $i++) {
    ?>
  <?php 
    $top_analyst = $top_analysts[$i];
    ?>
  
  <table style="border-bottom: 1px dotted #EEEEEE;">
    <tr>
      <td style="padding: 0.5em; width: 40px;">
        <?php 
    echo user_pic($top_analyst, 'profile', array('width' => 40));
    ?>
      </td>
      <td style="padding: 0.5em;">
        <span class="text_big"><?php 
    echo user_link($top_analyst);
    ?>
</span>
        <br />
        <span style="color: #666;"><?php 
    echo $top_analyst->group_score;
    ?>
 points</span>
      </td>
    </tr>
  </table>
<?php 
}
?>

<?php 
Exemple #15
0
<?php 
include_partial('global/section', array('title' => 'Recent Chatters', 'pointer' => 'Analysts who have viewed this page in the past five minutes'));
?>
<table>
<?php 
foreach ($users as $u) {
    ?>
  <tr>
    <td style="width: 50px; padding-top: 5px;">
      <?php 
    echo user_pic($u, 'profile', array('width' => 40));
    ?>
    </td>
    <td style="vertical-align: middle;">   
      <span class="text_big"><?php 
    echo user_link($u);
    ?>
</span>
    </td>
  </tr>
<?php 
}
?>
</table>
<?php 
end_slot();
?>



<script type="text/javascript">
Exemple #16
0
<?php

$fields = $object->Field;
?>


<tr>
  <td>
    <?php 
echo user_link($object->User);
?>
 
    <?php 
echo time_ago_in_words(strtotime($object->created_at));
?>
    ago
  </td>  
  <td>
    <?php 
if ($obj = $object->getObject()) {
    ?>
      <?php 
    echo object_link($obj);
    ?>
    <?php 
} else {
    ?>
      <strong><?php 
    echo $object->object_name;
    ?>
</strong>
Exemple #17
0
 public function go_user()
 {
     redirect(user_link(req()->get('name')));
 }
function user_myshifts()
{
    global $LETZTES_AUSTRAGEN;
    global $user, $privileges;
    $msg = "";
    if (isset($_REQUEST['id']) && in_array("user_shifts_admin", $privileges) && preg_match("/^[0-9]{1,}\$/", $_REQUEST['id']) && sql_num_query("SELECT * FROM `User` WHERE `UID`='" . sql_escape($_REQUEST['id']) . "'") > 0) {
        $id = $_REQUEST['id'];
    } else {
        $id = $user['UID'];
    }
    list($shifts_user) = sql_select("SELECT * FROM `User` WHERE `UID`='" . sql_escape($id) . "' LIMIT 1");
    if (isset($_REQUEST['reset'])) {
        if ($_REQUEST['reset'] == "ack") {
            User_reset_api_key($user);
            success(_("Key changed."));
            redirect(page_link_to('user_myshifts'));
        }
        return page_with_title(_("Reset API key"), array(error(_("If you reset the key, the url to your iCal- and JSON-export and your atom feed changes! You have to update it in every application using one of these exports."), true), button(page_link_to('user_myshifts') . '&reset=ack', _("Continue"), 'btn-danger')));
    } elseif (isset($_REQUEST['edit']) && preg_match("/^[0-9]*\$/", $_REQUEST['edit'])) {
        $id = $_REQUEST['edit'];
        $shift = sql_select("SELECT\n        `ShiftEntry`.`freeloaded`,\n        `ShiftEntry`.`freeload_comment`,\n        `ShiftEntry`.`Comment`,\n        `ShiftEntry`.`UID`,\n        `ShiftTypes`.`name`,\n        `Shifts`.*,\n        `Room`.`Name`,\n        `AngelTypes`.`name` as `angel_type`\n        FROM `ShiftEntry`\n        JOIN `AngelTypes` ON (`ShiftEntry`.`TID` = `AngelTypes`.`id`)\n        JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID`)\n        JOIN `ShiftTypes` ON (`ShiftTypes`.`id` = `Shifts`.`shifttype_id`)\n        JOIN `Room` ON (`Shifts`.`RID` = `Room`.`RID`)\n        WHERE `ShiftEntry`.`id`='" . sql_escape($id) . "'\n        AND `UID`='" . sql_escape($shifts_user['UID']) . "' LIMIT 1");
        if (count($shift) > 0) {
            $shift = $shift[0];
            if (isset($_REQUEST['submit'])) {
                $freeloaded = $shift['freeloaded'];
                $freeload_comment = $shift['freeload_comment'];
                if (in_array("user_shifts_admin", $privileges)) {
                    $freeloaded = isset($_REQUEST['freeloaded']);
                    $freeload_comment = strip_request_item_nl('freeload_comment');
                }
                $comment = strip_request_item_nl('comment');
                $user_source = User($shift['UID']);
                $result = ShiftEntry_update(array('id' => $id, 'Comment' => $comment, 'freeloaded' => $freeloaded, 'freeload_comment' => $freeload_comment));
                if ($result === false) {
                    engelsystem_error('Unable to update shift entr.');
                }
                engelsystem_log("Updated " . User_Nick_render($user_source) . "'s shift " . $shift['name'] . " from " . date("Y-m-d H:i", $shift['start']) . " to " . date("Y-m-d H:i", $shift['end']) . " with comment " . $comment . ". Freeloaded: " . ($freeloaded ? "YES Comment: " . $freeload_comment : "NO"));
                success(_("Shift saved."));
                redirect(page_link_to('users') . '&action=view&user_id=' . $shifts_user['UID']);
            }
            return ShiftEntry_edit_view(User_Nick_render($shifts_user), date("Y-m-d H:i", $shift['start']) . ', ' . shift_length($shift), $shift['Name'], $shift['name'], $shift['angel_type'], $shift['Comment'], $shift['freeloaded'], $shift['freeload_comment'], in_array("user_shifts_admin", $privileges));
        } else {
            redirect(page_link_to('user_myshifts'));
        }
    } elseif (isset($_REQUEST['cancel']) && preg_match("/^[0-9]*\$/", $_REQUEST['cancel'])) {
        $id = $_REQUEST['cancel'];
        $shift = sql_select("\n        SELECT *\n        FROM `Shifts` \n        INNER JOIN `ShiftEntry` USING (`SID`) \n        WHERE `ShiftEntry`.`id`='" . sql_escape($id) . "' AND `UID`='" . sql_escape($shifts_user['UID']) . "'");
        if (count($shift) > 0) {
            $shift = $shift[0];
            if ($shift['start'] > time() + $LETZTES_AUSTRAGEN * 3600 || in_array('user_shifts_admin', $privileges)) {
                $result = ShiftEntry_delete($id);
                if ($result === false) {
                    engelsystem_error('Unable to delete shift entry.');
                }
                $room = Room($shift['RID']);
                $angeltype = AngelType($shift['TID']);
                $shifttype = ShiftType($shift['shifttype_id']);
                engelsystem_log("Deleted own shift: " . $shifttype['name'] . " at " . $room['Name'] . " from " . date("Y-m-d H:i", $shift['start']) . " to " . date("Y-m-d H:i", $shift['end']) . " as " . $angeltype['name']);
                success(_("You have been signed off from the shift."));
            } else {
                error(_("It's too late to sign yourself off the shift. If neccessary, ask the dispatcher to do so."));
            }
        } else {
            redirect(user_link($shifts_user));
        }
    }
    redirect(page_link_to('users') . '&action=view');
}
Exemple #19
0
    ?>
      <td class="note_reply">&nbsp;</td>
    <?php 
}
?>


    <td class="note_pic">
      <?php 
echo user_pic($note['User'], 'profile', array('width' => 40));
?>
    </td>

    <td class="note_body">
      <?php 
echo user_link($note['User']);
?>
  
      <?php 
if ($note['is_private']) {
    ?>
        <?php 
    echo image_tag('system/lock.png');
    ?>
      <?php 
}
?>
  
      &nbsp;<?php 
echo NoteTable::prepareBodyForDisplay($note['body']);
?>
 static function convertValueForDisplay($value, $field, $excerpt = 40)
 {
     if (is_null($value)) {
         return 'NULL';
     }
     if (!($mod = self::loadModification($field))) {
         return $value;
     }
     $table = Doctrine::getTable($mod['object_model']);
     $columns = $table->getColumns();
     if ($mod['object_model'] == 'Entity') {
         if (!array_key_exists($field['field_name'], $columns)) {
             if ($extensionName = EntityTable::getExtensionNameByFieldName($field['field_name'])) {
                 $table = Doctrine::getTable($extensionName);
             }
         }
     } elseif ($mod['object_model'] == 'Relationship') {
         if (!array_key_exists($field['field_name'], $columns)) {
             $table = Doctrine::getTable(RelationshipTable::getCategoryNameByFieldName($field['field_name']));
         }
     }
     if ($alias = self::getFieldNameAlias($field)) {
         $class = $table->getRelation($alias)->getClass();
         if ($record = Doctrine::getTable($class)->find($value, Doctrine::HYDRATE_ARRAY)) {
             if ($class == 'Entity') {
                 sfLoader::loadHelpers('Ls');
                 return entity_link($record, null);
             } elseif ($class == 'sfGuardUser') {
                 sfLoader::loadHelpers('Ls');
                 return user_link($record);
             }
             return $record;
         }
     }
     if (in_array($field['field_name'], array('start_date', 'end_date'))) {
         return Dateable::convertForDisplay($value);
     }
     $def = $table->getColumnDefinition($field['field_name']);
     switch ($def['type']) {
         case 'integer':
             return (double) $value;
             break;
         case 'boolean':
             return $value ? 'yes' : 'no';
             break;
     }
     if ($excerpt) {
         $short = LsString::excerpt($value, $excerpt);
         return $short == $value ? $value : '<span title="' . strip_tags($value) . '">' . $short . '</span>';
     }
     return $value;
 }
Exemple #21
0
 /**
  * 发送消息给关注用户
  * @param null $rt
  * @param int  $f_id 被关注ID
  * @param int  $u_id 关注者ID
  * @return null
  */
 public function message_follow_me($rt, $f_id, $u_id)
 {
     try {
         if ($this->notice($f_id, 'message', 'follow_me')) {
             $user = User::getUser($u_id);
             $follow_user = User::getUser($f_id);
             $mt = new MailTemplate("message_notice/follow_me.md");
             $mt->setUserInfo($follow_user->getInfo());
             $mt->setValues(['follow_user_aliases' => $user->getAliases(), 'follow_user_url' => user_link($user->getName()), 'follow_list_link' => get_url('Follow', 'ta'), 'follow_user_name' => $user->getName()]);
             $this->message->addNoticeMsg($mt->getTitle(), $mt->getContent(), $f_id);
         }
     } catch (\Exception $ex) {
         Log::write(_("Message to message_follow_me create a Exception.") . "EX:[" . $ex->getCode() . "]:" . $ex->getMessage(), Log::NOTICE);
     }
     return $rt;
 }
Exemple #22
0
  <td class="padded" style="width: 300px;">
    <strong><?php 
    echo link_to($map->title ? $map->title : "Map " . $map->id, "map/view?id=" . $map->id);
    ?>
</strong>
  </td>
  <td class="padded" style="width: 50px;"><?php 
    echo count(explode(",", $map->entity_ids));
    ?>
</td>
  <td class="padded" style="width: 50px;"><?php 
    echo count(explode(",", $map->rel_ids));
    ?>
</td>
  <td class="padded" style="width: 100px;"><?php 
    echo user_link($map->getUser());
    ?>
</td>
  <td class="padded" style="width: 200px;"><?php 
    echo time_ago_in_words(strtotime($map->updated_at));
    ?>
 ago</td>
  <td class="padded" stype="width: 100px;">
    <?php 
    if ($sf_user->hasCredential('admin')) {
        ?>
      <?php 
        echo link_to('remove', 'map/delete?id=' . $map->id, array('post' => true, 'confirm' => 'Are you sure?'));
        ?>
    <?php 
    }
Exemple #23
0
        ?>
">
						<td>
							<p>标题:<span class="text-warning">[<?php 
        echo $v['msg_id'];
        ?>
]</span> <a href="#" onclick="return message_read(<?php 
        echo $v['msg_id'];
        ?>
)"><?php 
        echo $v['msg_title'] ? $v['msg_title'] : "无标题信息";
        ?>
</a></p>

							<p><span class="glyphicon glyphicon-user"></span>To:<a title="查看主页" rel="external" href="<?php 
        echo user_link($v['user_name']);
        ?>
"><?php 
        echo $v['user_aliases'];
        ?>
</a>
								<a class="glyphicon glyphicon-share-alt" href="<?php 
        echo get_url("Message");
        ?>
?s_to=<?php 
        echo urlencode($v['user_name']);
        ?>
" title="再次发送信息"></a> ,
								<span class="glyphicon glyphicon-time"></span>Time:<span class="text-info"><?php 
        echo convert_time($v['msg_datetime']);
        ?>
function user_resend_verification_token()
{
    global $user, $privileges;
    $success = false;
    if (isset($_GET['uid'])) {
        $uid = $_GET['uid'];
        if (is_numeric($uid)) {
            $user = User($uid);
            if ($user != null && $user['user_account_approved'] == 0) {
                // found user entry, check verification bit set? and send email
                user_send_verification_email($user['email'], $user['mailaddress_verification_token']);
                success(_("Verification E-Mail was send again to your E-Mail address. If you still don't receive it, please check your spam folder and ask a Dispatcher."));
                $success = true;
            }
        }
    } elseif (isset($_REQUEST['email']) && strlen(strip_request_item('email')) > 0) {
        $email = strip_request_item('email');
        if (check_email($email)) {
            $user = User_by_email($email);
            if ($user != null && $user['user_account_approved'] == 0) {
                user_send_verification_email($user['email'], $user['mailaddress_verification_token']);
                success(_("Verification E-Mail was send again to your E-Mail address. If you still don't receive it, please check your spam folder and ask a Dispatcher."));
                $success = true;
            }
        }
    } else {
        // show page to input E-Mail
        return User_request_verification_token_view();
    }
    $admin_priv = in_array('admin_user', $privileges);
    if ($success == false) {
        // failure, couldn't find user or something went wrong
        error(_("Verification E-Mail Could not be send. Please ask a Dispatcher."));
    }
    if ($admin_priv && $success == true && isset($user) && isset($user['UID'])) {
        redirect(user_link($user));
    } else {
        redirect('?');
    }
}
Exemple #25
0
$homepage = $pkg['homepage'];
$pacid = $pkg['packageid'];
$cvs_link = $pkg['cvs_link'];
$doc_link = $pkg['doc_link'];
$bug_link = $pkg['bug_link'];
$unmaintained = $pkg['unmaintained'] ? 'Y' : 'N';
$supersede = (bool) $pkg['new_channel'];
// Maintainer information
include_once 'pear-database-maintainer.php';
$maintainers = maintainer::get($pacid);
$accounts = '<ul>' . "\n";
//$bugs = new PEAR_Bugs;
foreach ($maintainers as $handle => $row) {
    //$buginfo = $bugs->getRank($handle);
    $accounts .= '<li>';
    $accounts .= user_link($handle);
    $accounts .= ' (' . $row['role'] . ($row['active'] == 0 ? ', inactive' : '');
    $accounts .= ')</li>' . "\n";
}
$accounts .= '</ul>' . "\n";
$channel_name = PEAR_CHANNELNAME;
if ($pkg['blocktrackbacks']) {
    $trackback_header = '';
} else {
    $trackback_uri = "http://{$channel_name}/trackback/trackback.php?id={$name}";
    $trackback_header = <<<EOD
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
    <rdf:Description
Exemple #26
0
"><?php 
        echo $from_user->getAliases();
        ?>
(<?php 
        echo $from_user->getName();
        ?>
)</a>
					<?php 
    } else {
        ?>
						发送人:<span class="text-warning">系统信息</span>
					<?php 
    }
    ?>
					&nbsp;&nbsp;收件人:<a title="查看主页" href="<?php 
    echo user_link($to_user->getName());
    ?>
"><?php 
    echo $to_user->getAliases();
    ?>
(<?php 
    echo $to_user->getName();
    ?>
)</a></p>
			</div>
			<?php 
    if ($from_user !== NULL && $to_user->getId() === login_user()->getId()) {
        ?>
				<div class="well well-sm">
					<form id="MessageSendForm" method="post" action="<?php 
        echo get_url("UserApi", "message_send");
Exemple #27
0
/**
 * View for editing the number of given vouchers
 */
function User_edit_vouchers_view($user)
{
    return page_with_title(sprintf(_("%s's vouchers"), User_Nick_render($user)), [msg(), buttons([button(user_link($user), glyph('chevron-left') . _("back"))]), form([form_spinner('vouchers', _("Number of vouchers"), $user['got_voucher']), form_submit('submit', _("Save"))], page_link_to('users') . '&action=edit_vouchers&user_id=' . $user['UID'])]);
}
Exemple #28
0
										【<a title="查看封面" href="#" onclick="return view_front_cover(<?php 
            echo $follow['gallery_front_cover'];
            ?>
)" class="glyphicon glyphicon-eye-open"></a>】
									<?php 
        }
        ?>
								</p>

								<p>图集描述:<code><?php 
        echo $follow['gallery_description'];
        ?>
</code></p>

								<p>所属用户:<a rel="external" href="<?php 
        echo user_link($user->getName());
        ?>
"><?php 
        echo $user->getAliases();
        ?>
</a> (<?php 
        echo $user->getName();
        ?>
)</p>

								<p>关注时间:<span><?php 
        echo $follow['follow_time'];
        ?>
</span></p>
							</div>
						</td>
Exemple #29
0
}
switch ($action) {
    case 'makedocbug':
        if (isset($_GET['noteId'])) {
            $noteId = (int) $_GET['noteId'];
            $note = $manualNotes->getSingleCommentById($noteId);
            $registered = 1;
            $package = getPackageNameForId($note['page_url']);
            $package_name = is_null($package) ? 'Documentation' : $package;
            $bug_type = 'Documentation Problem';
            $email = $auth_user->email;
            $handle = $auth_user->handle;
            $sdesc = 'User note that is a documentation problem';
            $ldesc = 'Manual page: ' . $note['page_url'] . "\n" . 'Note submitter:' . "\n";
            if (!empty($note['user_handle'])) {
                $ldesc .= user_link($note['user_handle'], true);
            } else {
                include_once 'bugs/pear-bugs-utils.php';
                $ldesc .= PEAR_Bugs_Utils::spamProtect($note['user_name'], 'text');
            }
            $ldesc .= "\n\n" . str_replace('<br />', '', $dbh->escapeSimple(html_entity_decode($note['note_text'])));
            $package_version = null;
            $php_version = 'Irrelevant';
            $php_os = 'Irrelevant';
            $status = 'Open';
            $passwd = null;
            $reporter_name = $auth_user->name;
            $sql = "\n                INSERT INTO bugdb (\n                    registered,\n                    package_name,\n                    bug_type,\n                    email,\n                    handle,\n                    sdesc,\n                    ldesc,\n                    package_version,\n                    php_version,\n                    php_os,\n                    status,\n                    ts1,\n                    passwd,\n                    reporter_name\n                ) VALUES (\n                    ?, ?, ?, ?, ?,\n                    ?, ?, null, ?, ?,\n                    ?, NOW(), null, ?\n                )\n            ";
            $args = array($registered, $package_name, $bug_type, $email, $handle, $sdesc, $ldesc, $php_version, $php_os, $status, $reporter_name);
            $dbh->query($sql, $args);
            // TODO: add error handling
Exemple #30
0
<tr>
  <td><?php 
echo $object->created_at;
?>
</td>
  <td><?php 
echo user_link($object->User, 'frontend');
?>
</td>
  <td><?php 
echo $object->module;
?>
</td>
  <td><?php 
echo $object->action;
?>
</td>
  <td title="<?php 
echo $object->params;
?>
"><?php 
echo excerpt($object->params, 80);
?>
</td>
  <td>
    <?php 
if (!$sf_request->getParameter('user_id')) {
    ?>
      <?php 
    echo link_to('limit by user', 'post/list?user_id=' . $object->user_id);
    ?>