user_list.php

Go to the documentation of this file.
00001 <?php
00002 
00008 class User_List extends oxAdminList
00009 {
00015     protected $_sListClass = 'oxuser';
00016 
00022     protected $_sDefSort = "oxuser.oxusername";
00023 
00029     protected $_sListType = 'oxuserlist';
00030 
00035     protected $_sThisTemplate = 'user_list.tpl';
00036 
00043     public function init()
00044     {
00045         parent::Init();
00046 
00047         // set mark for blacklists
00048         foreach ( $this->_oList as $name => $value ) {
00049             if ( $value->inGroup( "oxidblacklist") || $value->inGroup( "oxidblocked")) {
00050                 $value->blacklist = "1";
00051                 $this->_oList[$name] = $value;
00052             }
00053             $this->_oList[$name]->blPreventDelete = false;
00054             if (!$this->_allowAdminEdit($name)) {
00055                 $this->_oList[$name]->blPreventDelete = true;
00056             }
00057         }
00058     }
00059 
00066     public function deleteEntry()
00067     {
00068         $soxId = oxConfig::getParameter( "oxid");
00069         if (!$this->_allowAdminEdit($soxId))
00070             return;
00071 
00072         return parent::deleteEntry();
00073     }
00074 
00085     public function _prepareWhereQuery( $aWhere, $sqlFull )
00086     {
00087         $aNameWhere = null;
00088         if ( isset( $aWhere['oxuser.oxlname'] ) && ( $sName = $aWhere['oxuser.oxlname'] ) ) {
00089             // check if this is search string (contains % sign at begining and end of string)
00090             $blIsSearchValue = $this->_isSearchValue( $sName );
00091             $sName = $this->_processFilter( $sName );
00092             $aNameWhere['oxuser.oxfname'] = $aNameWhere['oxuser.oxlname'] = $sName;
00093 
00094             // unsetting..
00095             unset( $aWhere['oxuser.oxlname'] );
00096         }
00097         $sQ = parent::_prepareWhereQuery( $aWhere, $sqlFull );
00098 
00099         if ( $aNameWhere ) {
00100 
00101             $aVal = explode( ' ', $sName );
00102             $sQ .= ' and (';
00103             $sSqlBoolAction = '';
00104             $myUtilsString = oxUtilsString::getInstance();
00105 
00106             foreach ( $aNameWhere as $sFieldName => $sValue ) {
00107 
00108                 //for each search field using AND anction
00109                 foreach ( $aVal as $sVal ) {
00110 
00111                     $sQ .= " {$sSqlBoolAction} {$sFieldName} ";
00112 
00113                     //for search in same field for different values using AND
00114                     $sSqlBoolAction = ' or ';
00115 
00116                     $sQ .= $this->_buildFilter( $sVal, $blIsSearchValue );
00117 
00118                     // trying to search spec chars in search value
00119                     // if found, add cleaned search value to search sql
00120                     $sUml = $myUtilsString->prepareStrForSearch( $sVal );
00121                     if ( $sUml ) {
00122                         $sQ .= " or {$sFieldName} ";
00123                         $sQ .= $this->_buildFilter( $sUml, $blIsSearchValue );
00124                     }
00125                 }
00126             }
00127 
00128             // end for AND action
00129             $sQ .= ' ) ';
00130         }
00131 
00132 
00133         return $sQ;
00134     }
00135 
00136 }

Generated on Tue Aug 18 09:21:05 2009 for OXID eShop CE by  doxygen 1.5.5