本文整理汇总了PHP中user_get_email函数的典型用法代码示例。如果您正苦于以下问题:PHP user_get_email函数的具体用法?PHP user_get_email怎么用?PHP user_get_email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了user_get_email函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mci_account_get_array_by_id
/**
* Get username, realname and email from for a given user id
* @param integer $p_user_id A valid user identifier.
* @return array
*/
function mci_account_get_array_by_id($p_user_id)
{
$t_result = array();
$t_result['id'] = $p_user_id;
if (user_exists($p_user_id)) {
$t_current_user_id = auth_get_current_user_id();
$t_access_level = user_get_field($t_current_user_id, 'access_level');
$t_can_manage = access_has_global_level(config_get('manage_user_threshold')) && access_has_global_level($t_access_level);
# this deviates from the behaviour of view_user_page.php, but it is more intuitive
$t_is_same_user = $t_current_user_id === $p_user_id;
$t_can_see_realname = access_has_project_level(config_get('show_user_realname_threshold'));
$t_can_see_email = access_has_project_level(config_get('show_user_email_threshold'));
$t_result['name'] = user_get_field($p_user_id, 'username');
if ($t_is_same_user || $t_can_manage || $t_can_see_realname) {
$t_realname = user_get_realname($p_user_id);
if (!empty($t_realname)) {
$t_result['real_name'] = $t_realname;
}
}
if ($t_is_same_user || $t_can_manage || $t_can_see_email) {
$t_email = user_get_email($p_user_id);
if (!empty($t_email)) {
$t_result['email'] = $t_email;
}
}
}
return $t_result;
}
示例2: email_group_reminder
function email_group_reminder($p_user_id, $issues)
{
$t_username = user_get_field($p_user_id, 'username');
$t_email = user_get_email($p_user_id);
$t_message = $issues;
$t_subject = config_get('plugin_Reminder_reminder_subject');
if (!is_blank($t_email)) {
email_store($t_email, $t_subject, $t_message);
if (OFF == config_get('email_send_using_cronjob')) {
email_send_all();
}
}
}
示例3: buildNotificationEmails
/**
* Builds notification emails for the selected customers about changes made in bugs reports they are linked to
*
* @param array $customer_ids the ids of the customer to notify
* @param string $from the start of the interval
* @param string $to the end of the interval
*
* @return array notified customers
*/
static function buildNotificationEmails($customer_ids, $from, $to)
{
$emails = array();
lang_push(plugin_config_get('email_notification_language'));
$fromDate = self::startOfDay(strtotime($from));
$toDate = self::endOfDay(strtotime($to));
$changedBugIds = CustomerManagementDao::findAllChangedBugIds($customer_ids, $fromDate, $toDate);
$dateFormat = config_get('short_date_format');
foreach ($customer_ids as $customer_id) {
$changesForCustomer = array();
foreach ($changedBugIds as $changedBugId) {
if ($changedBugId['customer_id'] == $customer_id) {
$changesForCustomer[] = array('bug' => bug_get($changedBugId['bug_id']));
}
}
if (count($changesForCustomer) > 0) {
$counter = 0;
$text = '';
foreach ($changesForCustomer as $changeForCustomer) {
$counter++;
$bugId = $changeForCustomer['bug']->id;
$text .= $counter . '. ';
$text .= sprintf(plugin_lang_get('email_notification_bug_header'), $changeForCustomer['bug']->id, $changeForCustomer['bug']->summary, date($dateFormat, $changeForCustomer['bug']->date_submitted), get_enum_element('status', $changeForCustomer['bug']->status));
$text .= "\n";
$reporterName = user_get_name($changeForCustomer['bug']->reporter_id);
$reporterEmail = user_get_email($changeForCustomer['bug']->reporter_id);
$text .= sprintf(plugin_lang_get('email_notification_bug_reported_by'), $reporterName, $reporterEmail);
$text .= "\n";
$text .= sprintf(plugin_lang_get('email_notification_bug_description'), $changeForCustomer['bug']->description);
$text .= "\n\n";
}
$customer = CustomerManagementDao::getCustomer($customer_id);
$email = new EmailData();
$email->email = $customer['email'];
$email->subject = sprintf(plugin_lang_get('email_notification_title'), $customer['name'], $from, $to);
$email->body = $text;
$email->metadata['priority'] = config_get('mail_priority');
$email->metadata['charset'] = 'utf-8';
array_push($emails, $email);
}
}
lang_pop();
return $emails;
}
示例4: prepare_user_name
function prepare_user_name($p_user_id)
{
# Catch a user_id of NO_USER (like when a handler hasn't been assigned)
if (NO_USER == $p_user_id) {
return '';
}
$t_username = user_get_name($p_user_id);
if (user_exists($p_user_id) && user_get_field($p_user_id, 'enabled')) {
$t_email = user_get_email($p_user_id);
if (!is_blank($t_email)) {
return prepare_email_link($t_email, $t_username);
} else {
return string_display($t_username);
}
} else {
$t_result = '<font STYLE="text-decoration: line-through">';
$t_result .= string_display($t_username);
$t_result .= '</font>';
return $t_result;
}
}
示例5: require_api
require_api('print_api.php');
require_api('string_api.php');
require_api('user_api.php');
require_api('utility_api.php');
auth_ensure_user_authenticated();
# extracts the user information for the currently logged in user
# and prefixes it with u_
$f_user_id = gpc_get_int('id', auth_get_current_user_id());
$row = user_get_row($f_user_id);
extract($row, EXTR_PREFIX_ALL, 'u');
$t_can_manage = access_has_global_level(config_get('manage_user_threshold')) && access_has_global_level($u_access_level);
$t_can_see_realname = access_has_project_level(config_get('show_user_realname_threshold'));
$t_can_see_email = access_has_project_level(config_get('show_user_email_threshold'));
# In case we're using LDAP to get the email address... this will pull out
# that version instead of the one in the DB
$u_email = user_get_email($u_id);
$u_realname = user_get_realname($u_id);
html_page_top();
?>
<br />
<div align="center">
<table class="width75" cellspacing="1">
<tr>
<td class="form-title">
<?php
echo lang_get('view_account_title');
?>
</td>
</tr>
<tr <?php
示例6: email_bug_info_to_one_user
/**
* Send bug info to given user
* return true on success
* @param array $p_visible_bug_data
* @param string $p_message_id
* @param int $p_project_id
* @param int $p_user_id
* @param array $p_header_optional_params
* @return bool
*/
function email_bug_info_to_one_user($p_visible_bug_data, $p_message_id, $p_project_id, $p_user_id, $p_header_optional_params = null)
{
$t_user_email = user_get_email($p_user_id);
# check whether email should be sent
# @@@ can be email field empty? if yes - then it should be handled here
if (ON !== config_get('enable_email_notification') || is_blank($t_user_email)) {
return true;
}
# build subject
$t_subject = email_build_subject($p_visible_bug_data['email_bug']);
# build message
$t_message = lang_get_defaulted($p_message_id, null);
if (is_array($p_header_optional_params)) {
$t_message = vsprintf($t_message, $p_header_optional_params);
}
if ($t_message !== null && !is_blank($t_message)) {
$t_message .= " \n";
}
$t_message .= email_format_bug_message($p_visible_bug_data);
# build headers
$t_bug_id = $p_visible_bug_data['email_bug'];
$t_message_md5 = md5($t_bug_id . $p_visible_bug_data['email_date_submitted']);
$t_mail_headers = array('keywords' => $p_visible_bug_data['set_category']);
if ($p_message_id == 'email_notification_title_for_action_bug_submitted') {
$t_mail_headers['Message-ID'] = $t_message_md5;
} else {
$t_mail_headers['In-Reply-To'] = $t_message_md5;
}
# send mail
$t_ok = email_store($t_user_email, $t_subject, $t_message, $t_mail_headers);
#LB/BFE: hook for plugin getting additional cc email for $p_user_id and sending email via email store
$t_cc_ok = event_signal('EVENT_SEND_EMAIL_TO_CC_ADDRESS', array($p_user_id, $t_subject, $t_message, $t_mail_headers, $p_project_id));
#$t_recipients_include_data = event_signal( 'EVENT_NOTIFY_USER_INCLUDE', array( $p_bug_id, $p_notify_type ) );
return $t_ok;
}
示例7: print_user_with_subject
function print_user_with_subject($p_user_id, $p_bug_id)
{
$c_user_id = db_prepare_int($p_user_id);
if (NO_USER == $p_user_id) {
return;
}
$t_username = user_get_name($p_user_id);
if (user_exists($p_user_id) && user_get_field($p_user_id, 'enabled')) {
$t_email = user_get_email($p_user_id);
print_email_link_with_subject($t_email, $t_username, $p_bug_id);
} else {
echo '<span style="text-decoration: line-through">';
echo $t_username;
echo '</span>';
}
}
示例8: helper_alternate_class
$t_removable_users_exist = false;
for ($i = 0; $i < $t_users_count; $i++) {
$t_user = $t_users[$i];
?>
<tr <?php
echo helper_alternate_class();
?>
>
<td>
<?php
echo $t_display[$i];
?>
</td>
<td>
<?php
$t_email = user_get_email($t_user['id']);
print_email_link($t_email, $t_email);
?>
</td>
<td>
<?php
echo get_enum_element('access_levels', $t_user['access_level']);
?>
</td>
<td class="center">
<?php
# You need global or project-specific permissions to remove users
# from this project
if ($t_can_manage_users && access_has_project_level($t_user['access_level'], $f_project_id)) {
if (project_includes_user($f_project_id, $t_user['id'])) {
print_button("manage_proj_user_remove.php?project_id={$f_project_id}&user_id=" . $t_user['id'], lang_get('remove_link'));
示例9: helper_alternate_class
<!-- Email -->
<tr <?php
echo helper_alternate_class();
?>
>
<td class="category">
<?php
echo lang_get('email');
?>
</td>
<td>
<?php
// With LDAP
if ($t_ldap && ON == config_get('use_ldap_email')) {
echo string_display_line(user_get_email($t_user_id));
} else {
print_email_input('email', $t_user['email']);
}
?>
</td>
</tr>
<!-- Access Level -->
<tr <?php
echo helper_alternate_class();
?>
>
<td class="category">
<?php
echo lang_get('access_level');
示例10: user_get_avatar
/**
* Return the user avatar image URL
* in this first implementation, only gravatar.com avatars are supported
* @return array|bool an array( URL, width, height ) or false when the given user has no avatar
*/
function user_get_avatar($p_user_id)
{
$t_email = strtolower(user_get_email($p_user_id));
if (is_blank($t_email)) {
$t_result = false;
} else {
$t_default_image = config_get('default_avatar');
$t_size = 80;
$t_use_ssl = false;
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') {
$t_use_ssl = true;
}
if (!$t_use_ssl) {
$t_gravatar_domain = 'http://www.gravatar.com/';
} else {
$t_gravatar_domain = 'https://secure.gravatar.com/';
}
$t_avatar_url = $t_gravatar_domain . 'avatar.php?gravatar_id=' . md5($t_email) . '&default=' . urlencode($t_default_image) . '&size=' . $t_size . '&rating=G';
$t_result = array($t_avatar_url, $t_size, $t_size);
}
return $t_result;
}
示例11: config_get
require_once 'core.php';
require_once 'current_user_api.php';
$t_use_gravatar = config_get('use_gravatar', false, auth_get_current_user_id(), ALL_PROJECTS);
#============ Parameters ============
# (none)
#============ Permissions ============
auth_ensure_user_authenticated();
current_user_ensure_unprotected();
# extracts the user information for the currently logged in user
# and prefixes it with u_
$row = user_get_row(auth_get_current_user_id());
extract($row, EXTR_PREFIX_ALL, 'u');
$t_ldap = LDAP == config_get('login_method');
# In case we're using LDAP to get the email address... this will pull out
# that version instead of the one in the DB
$u_email = user_get_email($u_id, $u_username);
# note if we are being included by a script of a different name, if so,
# this is a mandatory password change request
$t_force_pw_reset = is_page_name('verify.php');
# Only show the update button if there is something to update.
$t_show_update_button = false;
html_page_top(lang_get('account_link'));
?>
<!-- # Edit Account Form BEGIN -->
<br />
<?php
if ($t_force_pw_reset) {
?>
<center><div style="color:red; width:75%">
<?php
示例12: email_bug_info_to_one_user
/**
* Send bug info to given user
* return true on success
* @param array $p_visible_bug_data
* @param string $p_message_id
* @param int $p_project_id
* @param int $p_user_id
* @param array $p_header_optional_params
* @return bool
*/
function email_bug_info_to_one_user($p_visible_bug_data, $p_message_id, $p_project_id, $p_user_id, $p_header_optional_params = null)
{
$t_user_email = user_get_email($p_user_id);
# check whether email should be sent
# @@@ can be email field empty? if yes - then it should be handled here
if (ON !== config_get('enable_email_notification') || is_blank($t_user_email)) {
return true;
}
# busco el tipo de usuario que es
$access_level = '';
$query = 'SELECT access_level FROM mantis_user_table WHERE id = ' . $p_user_id;
$access_level = db_query_bound($query);
$access_level = db_result($access_level);
$user_information = '<br>';
if ($access_level == 90) {
// administrador
$user_information .= 'administrador';
} else {
if ($access_level == 55) {
// desarrollador - médico
$user_information .= 'medico';
} else {
if ($access_level == 25) {
// informador - usuario
$user_information .= 'usuario';
}
}
}
# build subject
//$t_subject = '[' . $p_visible_bug_data['email_project'] . ' ' . bug_format_id( $p_visible_bug_data['email_bug'] ) . ']: ' . $p_visible_bug_data['email_summary'];
$t_subject = '[Medicnexus]: ' . lang_project_name($p_visible_bug_data['email_project']);
# build message
# se agrega el encabezado del mensaje
$t_message = lang_get('tpl_mn_email_header');
$t_message .= lang_get_defaulted($p_message_id, null);
if (is_array($p_header_optional_params)) {
$t_message = vsprintf($t_message, $p_header_optional_params);
}
if ($t_message !== null && !is_blank($t_message)) {
$t_message .= " <br>";
}
//$t_message .= email_format_bug_message( $p_visible_bug_data );
// se agrega la información relacionada con los datos de la incidencia.
$t_message .= email_format_bug_message_medicnexus($p_visible_bug_data);
// se agrega la información adicional correspondiente al tipo de usuario.
$t_message .= " <br>" . $user_information;
# se colocal final del formato del mensaje
$t_message .= lang_get('tpl_mn_email_footer');
# build headers
$t_bug_id = $p_visible_bug_data['email_bug'];
$t_message_md5 = md5($t_bug_id . $p_visible_bug_data['email_date_submitted']);
$t_mail_headers = array('keywords' => $p_visible_bug_data['set_category']);
if ($p_message_id == 'email_notification_title_for_action_bug_submitted') {
$t_mail_headers['Message-ID'] = $t_message_md5;
} else {
$t_mail_headers['In-Reply-To'] = $t_message_md5;
}
# send mail
$t_ok = email_store($t_user_email, $t_subject, $t_message, $t_mail_headers);
return $t_ok;
}
示例13: helper_alternate_class
<!-- Email -->
<tr <?php
echo helper_alternate_class();
?>
>
<th class="category">
<?php
echo lang_get('email_label');
?>
</th>
<td>
<?php
if (!$t_ldap || config_get('use_ldap_email') == OFF) {
print_email_input('email', $t_user['email']);
} else {
echo string_display(user_get_email($f_user_id));
}
?>
</td>
</tr>
<!-- Access Level -->
<tr <?php
echo helper_alternate_class();
?>
>
<th class="category">
<?php
echo lang_get('access_level_label');
?>
</th>
示例14: db_get_table
}
}
// Get reporter
if (plugin_config_get('notify_reporter', PLUGINS_RELEASEMGT_NOTIFY_REPORTER_DEFAULT) == ON) {
if ($t_version == 0) {
$t_query = 'SELECT reporter_id FROM ' . db_get_table('mantis_bug_table') . ' WHERE project_id=' . db_prepare_int($t_project_id) . ' AND fixed_in_version=\'\'';
} else {
$t_query = 'SELECT reporter_id FROM ' . db_get_table('mantis_bug_table') . ' WHERE project_id=' . db_prepare_int($t_project_id) . ' AND fixed_in_version=\'' . db_prepare_string(version_get_field($t_version, 'version')) . '\'';
}
$t_result = db_query($t_query);
while ($t_row = db_fetch_array($t_result)) {
$t_id_list[] = $t_row['reporter_id'];
}
}
for ($i = 0; $i < count($t_id_list); $i++) {
$t_id_list[$i] = user_get_email($t_id_list[$i]);
}
// Add users
$t_emails = explode(',', plugin_config_get('notify_email', PLUGINS_RELEASEMGT_NOTIFY_EMAIL_DEFAULT));
foreach ($t_emails as $t_email) {
if (trim($t_email) != '') {
$t_id_list[] = trim($t_email);
}
}
$t_email_ids = array_unique($t_id_list);
if (defined('MANTIS_VERSION')) {
$t_mantis_version = MANTIS_VERSION;
} else {
$t_mantis_version = config_get('mantis_version');
}
if (version_compare($t_mantis_version, '1.1.0a2', '>=')) {
示例15: usermessage_send_to_user
function usermessage_send_to_user($user, $message_event)
{
// echo "<br />DEBUG1303: usermessage_send_to_user($user, $message_event)";
$sql = "SELECT type, subject, message, once, reward, sendby FROM " . PREFIX . "messages_to_users WHERE event='" . sql_safe($message_event) . "' ORDER BY activated DESC LIMIT 0,1";
if ($mm = mysql_query($sql)) {
if ($m = mysql_fetch_array($mm)) {
$adress = "";
$sendby = explode(",", $m['sendby']);
if (in_array("insite_privmess", $sendby)) {
//Skicka ett ingame-meddelande till användaren med meddelandet
$privmess_id = privmess_send(0, $user, $m['subject'], $m['message'], FALSE);
$adress .= "insite_privmess";
}
if (in_array("insite_notice", $sendby)) {
notice_send($user, $message_event, $m['type'], $m['subject'], $m['message']);
if ($adress != "") {
$adress .= ", ";
}
$adress .= "insite_notice";
}
if (in_array("email", $sendby)) {
$email = user_get_email($user);
mailer_send_mail($adress, user_get_name($user), $m['subject'], $m['message']);
if ($adress != "") {
$adress .= ", ";
}
$adress .= $email;
}
//Ge eventuellt belöning
if ($m['reward'] > 0) {
money_transaction(0, $user, $m['reward'], "Reward", $m['subject']);
}
//lägg in att detta skickats i messages_to_users_sent
$sql = "INSERT INTO " . PREFIX . "messages_to_users_sent SET\r\n\t\t\t\tuser='" . sql_safe($user) . "', \r\n\t\t\t\tmessage_event='" . sql_safe($message_event) . "',\r\n\t\t\t\tadress='" . $adress . "'";
if (isset($privmess_id)) {
$sql .= ", privmess_id=" . sql_safe($privmess_id);
}
$sql .= ";";
// echo "<br />DEBUG1753: $sql";
mysql_query($sql);
}
}
}