Ignore:
Timestamp:
02/22/06 03:41:59 (7 years ago)
Author:
anarcat
Message:

[project @ alternc: changeset 2005-12-17 17:12:07 by benjamin]
ajout fonction permettant de locker et delocker un username

Original author: benjamin
Date: 2005-12-17 17:12:07

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bureau/class/m_admin.php

    r695 r786  
    11<?php 
    22/* 
    3  $Id: m_admin.php,v 1.11 2005/05/27 22:13:29 arnaud-lb Exp $ 
     3 $Id: m_admin.php,v 1.12 2005/12/17 17:12:07 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 LICENSE 
     
    339339  /* ----------------------------------------------------------------- */ 
    340340  /** 
     341   * Lock an account 
     342   * 
     343   * Lock an account and prevent the user to access its account. 
     344   * 
     345   * @param $uid integer the uid number of the account we want to lock 
     346   * @return boolean Returns FALSE if an error occurs, TRUE if not. 
     347   */ 
     348  function lock_mem($uid) { 
     349    global $err,$db; 
     350    $err->log("admin","lock_mem",$uid); 
     351    if (!$this->enabled) { 
     352      $err->raise("admin",1); 
     353      return false; 
     354    } 
     355    $db=new DB_System(); 
     356    if ($db->query("UPDATE membres SET enabled='0' WHERE uid='$uid';")) { 
     357      return true; 
     358    } 
     359    else { 
     360      $err->raise("admin",2); 
     361      return false; 
     362    } 
     363  } 
     364 
     365 
     366  /* ----------------------------------------------------------------- */ 
     367  /** 
     368   * UnLock an account 
     369   * 
     370   * UnLock an account and prevent the user to access its account. 
     371   * 
     372   * @param $uid integer the uid number of the account we want to unlock 
     373   * @return boolean Returns FALSE if an error occurs, TRUE if not. 
     374   */ 
     375  function unlock_mem($uid) { 
     376    global $err,$db; 
     377    $err->log("admin","lock_mem",$uid); 
     378    if (!$this->enabled) { 
     379      $err->raise("admin",1); 
     380      return false; 
     381    } 
     382    $db=new DB_System(); 
     383    if ($db->query("UPDATE membres SET enabled='1' WHERE uid='$uid';")) { 
     384      return true; 
     385    } 
     386    else { 
     387      $err->raise("admin",2); 
     388      return false; 
     389    } 
     390  } 
     391 
     392 
     393 
     394  /* ----------------------------------------------------------------- */ 
     395  /** 
    341396   * Deletes an account 
    342397   * 
Note: See TracChangeset for help on using the changeset viewer.