]> git.mxchange.org Git - friendica.git/blobdiff - include/security.php
Fix ostatus bug related to only_full_group_by
[friendica.git] / include / security.php
index 23fc400b3a12f9a34c3d1c8724fb9fea669dd7dd..05371f71ca55d1a44559480ffc2c350197cc3add 100644 (file)
@@ -21,15 +21,18 @@ function cookie_hash($user) {
  */
 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);
@@ -52,7 +55,7 @@ function authenticate_success($user_record, $login_initial = false, $interactive
        $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);