/
pub
/
danecewa
/
jardigital.cz
/
web
/
www
/
actions_admin
/
Upload File
HOME
<?php if( $a == 'list' ){ if( isset( $sOption ) ){ if( $sOption == 'del' ) $content .= $oTpl->tbHtml( 'messages.tpl', 'DONE' ); elseif( $sOption == 'save' ) $content .= $oTpl->tbHtml( 'messages.tpl', 'DONE' ); } $content .= $oTpl->tbHtml( 'users.tpl', 'HEAD' ); $sList = listUsers( 'users.tpl' ); $content .= !empty( $sList ) ? $sList : $oTpl->tbHtml( 'messages.tpl', 'EMPTY' ); } elseif( $a == 'form' ){ if( isset( $_POST['sOption'] ) ){ if( !isset( $_POST['sLoginOld'] ) || ( isset( $_POST['sLoginOld'] ) && ( $_POST['sLoginOld'] == $_POST['sLogin'] || checkUserLoginNotExist( $_POST['sLogin'] ) == true ) ) ){ $iUser = saveUser( $_POST ); if( isset( $_POST['aPagesRelated'] ) && is_array( $_POST['aPagesRelated'] ) ) saveUserOrGroupPages( $iUser, null, $_POST['aPagesRelated'] ); else delPagesRelated( $iUser, null ); if( isset( $_POST['aGroupsRelated'] ) && is_array( $_POST['aGroupsRelated'] ) ) saveUserToGroups( $iUser, $_POST['aGroupsRelated'] ); else delUsersToGroups( $iUser ); header( 'Location: '.$_SERVER['PHP_SELF'].'?p=users-list&sOption=save' ); } else $content .= $oTpl->tbHtml( 'users.tpl', 'LOGIN_EXIST' ); } else{ if( isset( $iUser ) && is_numeric( $iUser ) ){ $aData = throwUser( $iUser ); $aSelected = throwArrayRelated( DB_USERS_PAGES, $iUser ); $aGroupsSelected = throwArrayRelated( DB_USERS_TO_GROUPS, $iUser, 0, 1 ); } else{ $sData1 = $lang['New']; $aSelected = null; $aGroupsSelected = null; } $sGroupsRelatedSelect = listUsersGroups( 'user_to_groups.tpl', $aGroupsSelected ); $sPagesRelated = listPagesAuthorized( 'pages_list_authorized.tpl', $aSelected ); $content .= $oTpl->tbHtml( 'users.tpl', 'FORM' ); } } elseif( $a == 'groupForm' ){ if( isset( $_POST['sOption'] ) ){ $iGroup = saveGroup( $_POST ); if( isset( $_POST['aPagesRelated'] ) && is_array( $_POST['aPagesRelated'] ) ) saveUserOrGroupPages( null, $iGroup, $_POST['aPagesRelated'] ); else delPagesRelated( null, $iGroup ); if( isset( $_POST['aUsersRelated'] ) && is_array( $_POST['aUsersRelated'] ) ) saveUsersToGroup( $iGroup, $_POST['aUsersRelated'] ); else delUsersToGroups( null, $iGroup, 'iGroup' ); header( 'Location: '.$_SERVER['PHP_SELF'].'?p=users-groupList&sOption=save' ); } if( isset( $iGroup ) && is_numeric( $iGroup ) ) $aData = throwGroup( $iGroup ); if( isset( $iGroup ) && isset( $aData ) ){ $aSelected = throwArrayRelated( DB_USERS_PAGES, $iGroup, 1 ); $aUsersSelected = throwArrayRelated( DB_USERS_TO_GROUPS, $iGroup, 1, 0 ); } else{ $sData1 = $lang['New']; $aSelected = null; $aUsersSelected = null; } $sUsersRelatedSelect = listUsers( 'group_to_users.tpl', $aUsersSelected ); $sPagesRelated = listPagesAuthorized( 'pages_list_authorized.tpl', $aSelected ); $content .= $oTpl->tbHtml( 'users_groups.tpl', 'FORM' ); } elseif( $a == 'groupList' ){ if( isset( $sOption ) ){ if( $sOption == 'del' ) $content .= $oTpl->tbHtml( 'messages.tpl', 'DONE' ); elseif( $sOption == 'save' ) $content .= $oTpl->tbHtml( 'messages.tpl', 'DONE' ); } $content .= $oTpl->tbHtml( 'users_groups.tpl', 'HEAD' ); $sList = listUsersGroups( 'users_groups.tpl', null, LANGUAGE ); $content .= !empty( $sList ) ? $sList : $oTpl->tbHtml( 'messages.tpl', 'EMPTY' ); } elseif( $a == 'delete' && isset( $iUser ) && is_numeric( $iUser ) ){ delUser( $iUser ); header( 'Location: '.$_SERVER['PHP_SELF'].'?p=users-list&sOption=del' ); } elseif( $p == 'pagesDelete' && isset( $iPage ) && is_numeric( $iPage ) ){ delPageAuthorized( $iPage ); delUsersPage( $iPage ); } elseif( $a == 'groupDelete' && isset( $iGroup ) && is_numeric( $iGroup ) ){ delUsersGroup( $iGroup ); header( 'Location: '.$_SERVER['PHP_SELF'].'?p=users-groupList&sOption=del' ); } ?>