*/
function new_cookie($time, $user = array()) {
- if ($time != 0)
+ if ($time != 0) {
$time = $time + time();
+ }
- if ($user)
+ if ($user) {
$value = json_encode(array("uid" => $user["uid"],
"hash" => cookie_hash($user),
"ip" => $_SERVER['REMOTE_ADDR']));
- else
+ }
+ else {
$value = "";
+ }
setcookie("Friendica", $value, $time, "/", "",
(get_config('system', 'ssl_policy') == SSL_POLICY_FULL), true);
$a->user = $user_record;
if($interactive) {
- if($a->user['login_date'] === '0000-00-00 00:00:00') {
+ if ($a->user['login_date'] <= NULL_DATE) {
$_SESSION['return_url'] = 'profile_photo/new';
$a->module = 'profile_photo';
info( t("Welcome ") . $a->user['username'] . EOL);