begin debug zentity

This commit is contained in:
friendica 2012-08-24 01:57:36 -07:00
parent b08d070e15
commit f0e299a97a
3 changed files with 3 additions and 97 deletions

View File

@ -9,7 +9,7 @@ function create_identity($arr) {
$nick = trim($_POST['nickname']);
$name = escape_tags($_POST['name']);
if(check_webbie(array($nick)) !== 'nick') {
if(check_webbie(array($nick)) !== $nick) {
$ret['message'] = t('Nickname has unsupported characters or is already being used on this site.');
return $ret;
}
@ -22,7 +22,7 @@ function create_identity($arr) {
$r = q("insert into entity ( entity_account_id, entity_primary,
entity_name, entity_address, entity_global_id, entity_prvkey,
entity_pubkey, entity_pageflags )
values( %d, %d, '%s', '%s', '%s' '%s', '%s', %d ) ",
values ( %d, %d, '%s', '%s', '%s', '%s', '%s', %d ) ",
intval(local_user()),
intval($primary),

View File

@ -158,7 +158,7 @@ function ping_init(&$a) {
$t5 = dba_timer();
$events = q("SELECT count(`event`.`id`) as total, type, start, adjust FROM `event`
WHERE `event`.`uid` = %d AND `start` < '%s' AND `finish` > '%s' and ignore = 0
WHERE `event`.`uid` = %d AND `start` < '%s' AND `finish` > '%s' and `ignore` = 0
ORDER BY `start` ASC ",
intval(local_user()),
dbesc(datetime_convert('UTC','UTC','now + 7 days')),

View File

@ -73,100 +73,6 @@ function zentity_post(&$a) {
return;
}
$user = $result['user'];
$using_invites = get_config('system','invitation_only');
$num_invites = get_config('system','number_invites');
$invite_id = ((x($_POST,'invite_id')) ? notags(trim($_POST['invite_id'])) : '');
if( $a->config['register_policy'] == REGISTER_OPEN ) {
if($using_invites && $invite_id) {
q("delete * from register where hash = '%s' limit 1", dbesc($invite_id));
set_pconfig($user['uid'],'system','invites_remaining',$num_invites);
}
$email_tpl = get_intltext_template("register_open_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
'$username' => $user['username'],
'$email' => $user['email'],
'$password' => $result['password'],
'$uid' => $user['uid'] ));
$res = mail($user['email'], sprintf(t('Registration details for %s'), $a->config['sitename']),
$email_tpl,
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
. 'Content-type: text/plain; charset=UTF-8' . "\n"
. 'Content-transfer-encoding: 8bit' );
if($res) {
info( t('Registration successful. Please check your email for further instructions.') . EOL ) ;
goaway(z_root());
}
}
elseif($a->config['register_policy'] == REGISTER_APPROVE) {
if(! strlen($a->config['admin_email'])) {
notice( t('Your registration can not be processed.') . EOL);
goaway(z_root());
}
$hash = random_string();
$r = q("INSERT INTO `register` ( `hash`, `created`, `uid`, `password`, `language` ) VALUES ( '%s', '%s', %d, '%s', '%s' ) ",
dbesc($hash),
dbesc(datetime_convert()),
intval($user['uid']),
dbesc($result['password']),
dbesc($a->language)
);
$r = q("SELECT `language` FROM `user` WHERE `email` = '%s' LIMIT 1",
dbesc($a->config['admin_email'])
);
if(count($r))
push_lang($r[0]['language']);
else
push_lang('en');
if($using_invites && $invite_id) {
q("delete * from register where hash = '%s' limit 1", dbesc($invite_id));
set_pconfig($user['uid'],'system','invites_remaining',$num_invites);
}
$email_tpl = get_intltext_template("register_verify_eml.tpl");
$email_tpl = replace_macros($email_tpl, array(
'$sitename' => $a->config['sitename'],
'$siteurl' => $a->get_baseurl(),
'$username' => $user['username'],
'$email' => $user['email'],
'$password' => $result['password'],
'$uid' => $user['uid'],
'$hash' => $hash
));
$res = mail($a->config['admin_email'], sprintf(t('Registration request at %s'), $a->config['sitename']),
$email_tpl,
'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
. 'Content-type: text/plain; charset=UTF-8' . "\n"
. 'Content-transfer-encoding: 8bit' );
pop_lang();
if($res) {
info( t('Your registration is pending approval by the site owner.') . EOL ) ;
goaway(z_root());
}
}
return;
}