本文整理汇总了PHP中get_account_id函数的典型用法代码示例。如果您正苦于以下问题:PHP get_account_id函数的具体用法?PHP get_account_id怎么用?PHP get_account_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_account_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init()
{
$ret = array();
call_hooks('home_init', $ret);
$splash = argc() > 1 && argv(1) === 'splash' ? true : false;
$channel = \App::get_channel();
if (local_channel() && $channel && $channel['xchan_url'] && !$splash) {
$dest = $channel['channel_startpage'];
if (!$dest) {
$dest = get_pconfig(local_channel(), 'system', 'startpage');
}
if (!$dest) {
$dest = get_config('system', 'startpage');
}
if (!$dest) {
$dest = z_root() . '/network';
}
goaway($dest);
}
if (remote_channel() && !$splash && $_SESSION['atoken']) {
$r = q("select * from atoken where atoken_id = %d", intval($_SESSION['atoken']));
if ($r) {
$x = channelx_by_n($r[0]['atoken_uid']);
if ($x) {
goaway(z_root() . '/channel/' . $x['channel_address']);
}
}
}
if (get_account_id() && !$splash) {
goaway(z_root() . '/new_channel');
}
}
示例2: __construct
public function __construct($owner = '')
{
global $phpgw, $phpgw_info;
$this->db = $phpgw->db;
if (isset($phpgw_info['user']['preferences']['common']['country']) && $phpgw_info['user']['preferences']['common']['country']) {
$this->users['user'] = $phpgw_info['user']['preferences']['common']['country'];
} else {
$this->users['user'] = 'US';
}
$owner_id = get_account_id($owner);
if ($owner_id != $phpgw_info['user']['account_id']) {
$owner_pref = CreateObject('phpgwapi.preferences', $owner_id);
$owner_prefs = $owner_pref->read();
if (isset($owner_prefs['calendar']['locale']) && $owner_prefs['common']['country']) {
$this->users['owner'] = $owner_prefs['common']['country'];
} else {
$this->users['owner'] = 'US';
}
}
if ($phpgw_info['server']['auto_load_holidays'] == True) {
while (list($key, $value) = each($this->users)) {
$this->is_network_load_needed($value);
}
}
}
示例3: post
function post()
{
if (!local_channel()) {
return;
}
if ($_SESSION['delegate']) {
return;
}
if (!x($_POST, 'qxz_password') || !strlen(trim($_POST['qxz_password']))) {
return;
}
if (!x($_POST, 'verify') || !strlen(trim($_POST['verify']))) {
return;
}
if ($_POST['verify'] !== $_SESSION['remove_account_verify']) {
return;
}
$account = \App::get_account();
$account_id = get_account_id();
if (!account_verify_password($account['account_email'], $_POST['qxz_password'])) {
return;
}
if ($account['account_password_changed'] != NULL_DATE) {
$d1 = datetime_convert('UTC', 'UTC', 'now - 48 hours');
if ($account['account_password_changed'] > d1) {
notice(t('Account removals are not allowed within 48 hours of changing the account password.') . EOL);
return;
}
}
$global_remove = intval($_POST['global']);
account_remove($account_id, 1 - $global_remove);
}
示例4: calendar_holiday
function calendar_holiday($owner = '')
{
$this->datetime = CreateObject('phpgwapi.datetime');
$this->db = $GLOBALS['phpgw']->db;
if (@$GLOBALS['phpgw_info']['user']['preferences']['common']['country']) {
$this->users['user'] = $GLOBALS['phpgw_info']['user']['preferences']['common']['country'];
} else {
$this->users['user'] = 'US';
}
$owner_id = get_account_id($owner);
if ($owner_id != $GLOBALS['phpgw_info']['user']['account_id']) {
$owner_pref = CreateObject('phpgwapi.preferences', $owner_id);
$owner_prefs = $owner_pref->read_repository();
if (isset($owner_prefs['calendar']['locale']) && $owner_prefs['common']['country']) {
$this->users['owner'] = $owner_prefs['common']['country'];
} else {
$this->users['owner'] = 'US';
}
}
if ($GLOBALS['phpgw_info']['server']['auto_load_holidays'] == True) {
while (list($key, $value) = each($this->users)) {
$this->is_network_load_needed($value);
}
}
}
示例5: init
function init()
{
$result = array('success' => false);
$mindate = $_REQUEST['mindate'] ? datetime_convert('UTC', 'UTC', $_REQUEST['mindate']) : '';
if (!$mindate) {
$mindate = datetime_convert('UTC', 'UTC', 'now - 14 days');
}
if (get_config('system', 'block_public') && !get_account_id() && !remote_channel()) {
$result['message'] = 'Public access denied';
json_return_and_die($result);
}
$observer = \App::get_observer();
$channel_address = argc() > 1 ? argv(1) : '';
if ($channel_address) {
$r = q("select channel_id, channel_name from channel where channel_address = '%s' and channel_removed = 0 limit 1", dbesc(argv(1)));
} else {
$x = get_sys_channel();
if ($x) {
$r = array($x);
}
$mindate = datetime_convert('UTC', 'UTC', 'now - 14 days');
}
if (!$r) {
$result['message'] = 'Channel not found.';
json_return_and_die($result);
}
logger('zotfeed request: ' . $r[0]['channel_name'], LOGGER_DEBUG);
$result['messages'] = zot_feed($r[0]['channel_id'], $observer['xchan_hash'], array('mindate' => $mindate));
$result['success'] = true;
json_return_and_die($result);
}
示例6: new_channel_content
function new_channel_content(&$a)
{
$acc = App::get_account();
if (!$acc || $acc['account_id'] != get_account_id()) {
notice(t('Permission denied.') . EOL);
return;
}
$default_role = '';
$aid = get_account_id();
if ($aid) {
$r = q("select count(channel_id) as total from channel where channel_account_id = %d", intval($aid));
if ($r && !intval($r[0]['total'])) {
$default_role = get_config('system', 'default_permissions_role');
}
$limit = account_service_class_fetch(get_account_id(), 'total_identities');
if ($r && $limit !== false) {
$channel_usage_message = sprintf(t("You have created %1\$.0f of %2\$.0f allowed channels."), $r[0]['total'], $limit);
} else {
$channel_usage_message = '';
}
}
$name = array('name', t('Name or caption'), x($_REQUEST, 'name') ? $_REQUEST['name'] : '', t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"'));
$nickhub = '@' . App::get_hostname();
$nickname = array('nickname', t('Choose a short nickname'), x($_REQUEST, 'nickname') ? $_REQUEST['nickname'] : '', sprintf(t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub));
$privacy_role = x($_REQUEST, 'permissions_role') ? $_REQUEST['permissions_role'] : "";
$role = array('permissions_role', t('Channel role and privacy'), $privacy_role ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/roles" target="_blank">' . t('Read more about roles') . '</a>', get_roles());
$o = replace_macros(get_markup_template('new_channel.tpl'), array('$title' => t('Create Channel'), '$desc' => t('A channel is your identity on this network. It can represent a person, a blog, or a forum to name a few. Channels can make connections with other channels to share information with highly detailed permissions.'), '$label_import' => t('or <a href="import">import an existing channel</a> from another location.'), '$name' => $name, '$role' => $role, '$default_role' => $default_role, '$nickname' => $nickname, '$submit' => t('Create'), '$channel_usage_message' => $channel_usage_message));
return $o;
}
示例7: removeaccount_post
function removeaccount_post(&$a)
{
if (!local_user()) {
return;
}
if (x($_SESSION, 'submanage') && intval($_SESSION['submanage'])) {
return;
}
if (!x($_POST, 'qxz_password') || !strlen(trim($_POST['qxz_password']))) {
return;
}
if (!x($_POST, 'verify') || !strlen(trim($_POST['verify']))) {
return;
}
if ($_POST['verify'] !== $_SESSION['remove_account_verify']) {
return;
}
$account = $a->get_account();
$account_id = get_account_id();
if (!account_verify_password($account['account_email'], $_POST['qxz_password'])) {
return;
}
if ($account['account_password_changed'] != NULL_DATE) {
$d1 = datetime_convert('UTC', 'UTC', 'now - 48 hours');
if ($account['account_password_changed'] > d1) {
notice(t('Account removals are not allowed within 48 hours of changing the account password.') . EOL);
return;
}
}
require_once 'include/Contact.php';
$global_remove = intval($_POST['global']);
account_remove($account_id, true);
}
示例8: feed_init
function feed_init(&$a)
{
$params = array();
$params['begin'] = x($_REQUEST, 'date_begin') ? $_REQUEST['date_begin'] : NULL_DATE;
$params['end'] = x($_REQUEST, 'date_end') ? $_REQUEST['date_end'] : '';
$params['type'] = stristr(argv(0), 'json') ? 'json' : 'xml';
$params['pages'] = x($_REQUEST, 'pages') ? intval($_REQUEST['pages']) : 0;
$params['top'] = x($_REQUEST, 'top') ? intval($_REQUEST['top']) : 0;
$params['start'] = x($params, 'start') ? intval($params['start']) : 0;
$params['records'] = x($params, 'records') ? intval($params['records']) : 40;
$params['direction'] = x($params, 'direction') ? dbesc($params['direction']) : 'desc';
$params['cat'] = x($_REQUEST, 'cat') ? escape_tags($_REQUEST['cat']) : '';
$channel = '';
if (argc() > 1) {
$r = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_address = '%s' limit 1", dbesc(argv(1)));
if (!($r && count($r))) {
killme();
}
$channel = $r[0];
if (intval(get_config('system', 'block_public')) && !get_account_id()) {
killme();
}
logger('mod_feed: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['channel_address']);
echo get_public_feed($channel, $params);
killme();
}
}
示例9: change_channel
function change_channel($change_channel)
{
$ret = false;
if ($change_channel) {
$r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel_id = %d and channel_account_id = %d and not ( channel_pageflags & %d) limit 1", intval($change_channel), intval(get_account_id()), intval(PAGE_REMOVED));
if ($r) {
$hash = $r[0]['channel_hash'];
$_SESSION['uid'] = intval($r[0]['channel_id']);
get_app()->set_channel($r[0]);
$_SESSION['theme'] = $r[0]['channel_theme'];
$_SESSION['mobile_theme'] = get_pconfig(local_user(), 'system', 'mobile_theme');
date_default_timezone_set($r[0]['channel_timezone']);
$ret = $r[0];
}
$x = q("select * from xchan where xchan_hash = '%s' limit 1", dbesc($hash));
if ($x) {
$_SESSION['my_url'] = $x[0]['xchan_url'];
$_SESSION['my_address'] = $r[0]['channel_address'] . '@' . substr(get_app()->get_baseurl(), strpos(get_app()->get_baseurl(), '://') + 3);
get_app()->set_observer($x[0]);
get_app()->set_perms(get_all_perms(local_user(), $hash));
}
if (!is_dir('store/' . $r[0]['channel_address'])) {
@os_mkdir('store/' . $r[0]['channel_address'], STORAGE_DEFAULT_PERMISSIONS, true);
}
}
return $ret;
}
示例10: change_channel
/**
* @brief Change to another channel with current logged-in account.
*
* @param int $change_channel The channel_id of the channel you want to change to
*
* @return bool|array false or channel record of the new channel
*/
function change_channel($change_channel)
{
$ret = false;
if ($change_channel) {
$r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel_id = %d and channel_account_id = %d and channel_removed = 0 limit 1", intval($change_channel), intval(get_account_id()));
// It's not there. Is this an administrator, and is this the sys channel?
if (is_developer()) {
if (!$r) {
if (is_site_admin()) {
$r = q("select channel.*, xchan.* from channel left join xchan on channel.channel_hash = xchan.xchan_hash where channel_id = %d and channel_system = 1 and channel_removed = 0 limit 1", intval($change_channel));
}
}
}
if ($r) {
$hash = $r[0]['channel_hash'];
$_SESSION['uid'] = intval($r[0]['channel_id']);
get_app()->set_channel($r[0]);
$_SESSION['theme'] = $r[0]['channel_theme'];
$_SESSION['mobile_theme'] = get_pconfig(local_channel(), 'system', 'mobile_theme');
date_default_timezone_set($r[0]['channel_timezone']);
$ret = $r[0];
}
$x = q("select * from xchan where xchan_hash = '%s' limit 1", dbesc($hash));
if ($x) {
$_SESSION['my_url'] = $x[0]['xchan_url'];
$_SESSION['my_address'] = $r[0]['channel_address'] . '@' . substr(get_app()->get_baseurl(), strpos(get_app()->get_baseurl(), '://') + 3);
get_app()->set_observer($x[0]);
get_app()->set_perms(get_all_perms(local_channel(), $hash));
}
if (!is_dir('store/' . $r[0]['channel_address'])) {
@os_mkdir('store/' . $r[0]['channel_address'], STORAGE_DEFAULT_PERMISSIONS, true);
}
}
return $ret;
}
示例11: __construct
/**
* Constructor
*
* @param integer $accountid Account id
* @param string $app_name Application name defaults to current application
*/
function __construct($accountid = '', $app_name = '', $location = '')
{
$account_id = (int) get_account_id($accountid);
if (!$app_name) {
$app_name = $GLOBALS['phpgw_info']['flags']['currentapp'];
}
$this->account_id = (int) $account_id;
$this->db =& $GLOBALS['phpgw']->db;
$this->set_appname($app_name, $location);
}
示例12: new_channel_content
function new_channel_content(&$a)
{
if (!get_account_id()) {
notice(t('Permission denied.') . EOL);
return;
}
$name = x($_REQUEST, 'name') ? $_REQUEST['name'] : "";
$nickname = x($_REQUEST, 'nickname') ? $_REQUEST['nickname'] : "";
$o = replace_macros(get_markup_template('new_channel.tpl'), array('$title' => t('Add a Channel'), '$desc' => t('A channel is your own collection of related web pages. A channel can be used to hold social network profiles, blogs, conversation groups and forums, celebrity pages, and much more. You may create as many channels as your service provider allows.'), '$label_name' => t('Channel Name'), '$help_name' => t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group" '), '$label_nick' => t('Choose a short nickname'), '$nick_desc' => t('Your nickname will be used to create an easily remembered channel address (like an email address) which you can share with others.'), '$label_import' => t('Or <a href="import">import an existing channel</a> from another location'), '$name' => $name, '$nickname' => $nickname, '$submit' => t('Create')));
return $o;
}
示例13: new_channel_content
function new_channel_content(&$a)
{
if (!get_account_id()) {
notice(t('Permission denied.') . EOL);
return;
}
$name = x($_REQUEST, 'name') ? $_REQUEST['name'] : "";
$nickname = x($_REQUEST, 'nickname') ? $_REQUEST['nickname'] : "";
$privacy_role = x($_REQUEST, 'permissions_role') ? $_REQUEST['permissions_role'] : "";
$o = replace_macros(get_markup_template('new_channel.tpl'), array('$title' => t('Add a Channel'), '$desc' => t('A channel is your own collection of related web pages. A channel can be used to hold social network profiles, blogs, conversation groups and forums, celebrity pages, and much more. You may create as many channels as your service provider allows.'), '$label_name' => t('Channel Name'), '$help_name' => t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group" '), '$label_nick' => t('Choose a short nickname'), '$nick_desc' => t('Your nickname will be used to create an easily remembered channel address (like an email address) which you can share with others.'), '$label_import' => t('Or <a href="import">import an existing channel</a> from another location'), '$name' => $name, '$help_role' => t('Please choose a channel type (such as social networking or community forum) and privacy requirements so we can select the best permissions for you'), '$role' => array('permissions_role', t('Channel Type'), $privacy_role ? $privacy_role : 'social', '<a href="help/roles" target="_blank">' . t('Read more about roles') . '</a>', get_roles()), '$nickname' => $nickname, '$submit' => t('Create')));
return $o;
}
示例14: categories
function categories($accountid = '', $app_name = '')
{
$account_id = get_account_id($accountid);
if (!$app_name) {
$app_name = $GLOBALS['phpgw_info']['flags']['currentapp'];
}
$this->account_id = $account_id;
$this->app_name = $GLOBALS['phpgw']->db->db_addslashes($app_name);
$this->db = $GLOBALS['phpgw']->db;
$this->db2 = $this->db;
$this->grants = $GLOBALS['phpgw']->acl->get_grants($app_name);
}
示例15: import_profiles
function import_profiles($channel, $profiles)
{
if ($channel && $profiles) {
foreach ($profiles as $profile) {
unset($profile['id']);
$profile['aid'] = get_account_id();
$profile['uid'] = $channel['channel_id'];
// we are going to reset all profile photos to the original
// somebody will have to fix this later and put all the applicable photos into the export
$profile['photo'] = z_root() . '/photo/profile/l/' . $channel['channel_id'];
$profile['thumb'] = z_root() . '/photo/profile/m/' . $channel['channel_id'];
dbesc_array($profile);
$r = dbq("INSERT INTO profile (`" . implode("`, `", array_keys($profile)) . "`) VALUES ('" . implode("', '", array_values($profile)) . "')");
}
}
}