~studentersamfundet-web/dns-inside/main

« back to all changes in this revision

Viewing changes to inside/functions.php

  • Committer: Nikolai Kristiansen
  • Date: 2011-09-01 22:30:24 UTC
  • Revision ID: nikolaik@gmail.com-20110901223024-v8vmp9gv3w53gkt1
Only members with a valid membership can migrate through the modal dialog. Note: Newly registered users are still migrated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1602
1602
    }
1603
1603
    return true;
1604
1604
}
 
1605
/* User has valid membership? */
 
1606
function membership_expired($uid) {
 
1607
    $conn = db_connect();
 
1608
 
 
1609
    $sql = sprintf("SELECT expires FROM din_user WHERE id=%s AND expires <= NOW()", $uid);
 
1610
    $result = $conn->query($sql);
 
1611
 
 
1612
    if (DB :: isError($result) == true) {
 
1613
        error("membership_expired: " . $result->toString());
 
1614
        return false;
 
1615
    }
 
1616
    return $result->numRows() > 0;
 
1617
}
1605
1618
/* Find a users groups */
1606
1619
function find_groups($uid) {
1607
1620
    $conn = db_connect();