dir/mod/redir.php
Roland Häder c353b31569
Cleanups:
- don't commit files that are being ignored, better provide a "template" file
  that needs copying to the right file and ignore the file that will have local
  changes like config files will always have.
- fixed CHMOD, no need for executable flag here as the server won't execute
  these files, but only load (read) them
- fixed E_NOTICE in boot.php when entrance/index page (no parameter) is being
  called

Signed-off-by: Roland Haeder <roland@mxchange.org>
2017-03-01 20:00:32 +01:00

18 lines
512 B
PHP

<?php
function redir_init(&$a) {
if((! local_user()) || (! ($a->argc == 2)) || (! intval($a->argv[1])))
goaway($a->get_baseurl());
$r = q("SELECT `dfrn-id`, `poll` FROM `contact` WHERE `id` = %d LIMIT 1",
intval($a->argv[1])
);
if(! count($r))
goaway($a->get_baseurl());
q("INSERT INTO `profile_check` ( `dfrn_id`, `expire`)
VALUES( '%s', %d )",
dbesc($r[0]['dfrn-id']),
intval(time() + 30));
goaway ($r[0]['poll'] . '?dfrn_id=' . $r[0]['dfrn-id'] . '&type=profile');
return; // NOTREACHED
}