Skip to content
Snippets Groups Projects
Select Git revision
  • 53e5a482ef698ae78873ea1188708c9a3c4ea0e4
  • 11.x default protected
  • 11.2.x protected
  • 10.5.x protected
  • 10.6.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

node.views.inc

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    user.module 83.79 KiB
    <?php
    // $Id$
    
    session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc");
    session_start();
    
    function user_system($field){
      $system["description"] = t("Enables the user registration and login system.");
      $system["admin_help"] = t("In order to use the full power of Drupal a visitor must sign up for an account. This page lets you setup how a user signs up, logs out, the guidelines from the system about user subscriptions, and the e-mails the system will send to the user.");
      return $system[$field];
    }
    
    /*** Session functions *****************************************************/
    
    function sess_open($save_path, $session_name) {
      return 1;
    }
    
    function sess_close() {
      return 1;
    }
    
    function sess_read($key) {
      global $user;
      $user = user_load(array("sid" => $key, "status" => 1));
    
      return !empty($user->session) ? $user->session : '';
    }
    
    function sess_write($key, $value) {
    
      db_query("UPDATE users SET hostname = '%s', session = '%s', timestamp = %d WHERE sid = '$key'", $_SERVER["REMOTE_ADDR"], $value, time());
    
      return '';
    }
    
    function sess_destroy($key) {
    
      db_query("UPDATE users SET hostname = '%s', timestamp = %d, sid = '' WHERE sid = '$key'", $_SERVER["REMOTE_ADDR"], time());
    }
    
    function sess_gc($lifetime) {
      return 1;
    }
    
    /*** Common functions ******************************************************/
    
    function user_external_load($authname) {
      $arr_uid = db_query("SELECT uid FROM authmap WHERE authname = '%s'", $authname);
    
      if (db_fetch_object($arr_uid)) {
        $uid = db_result($arr_uid);
        return user_load(array("uid" => $uid));
      }
      else {
        return 0;
      }
    }
    
    function user_load($array = array()) {
    
      /*
      ** Dynamically compose a SQL query:
      */
    
      $query = "";
    
      foreach ($array as $key => $value) {
        if ($key == "pass") {
          $query .= "u.$key = '". md5($value) ."' AND ";