Location: PHPKode > projects > Cynus > cynus/admin.php
<?php
/**
 * @file admin.php -- Provides administrative functions.
 * @Id $Id: admin.php,v 1.29 2004/06/28 19:20:16 jason Exp $
 *
 * Cynus - a web-based content manager
 * Copyright (C) 2003 Brett and Jason Profitt
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */


 
ini_set('max_execution_time', '120');
require_once('load_cynus.php');
cynus_debug ("Loaded admin.php", 3);

if(!verify_level(1)) {
	$content=login_prompt("Administrative Section");
} 
elseif(!verify_level(2)) {
	cynus_debug ("Insuffiecient access to admin section.", 2);
	$content='I\'m sorry, but you do not have the proper authentication level to access the Administrative Section.';
}
else {
	cynus_debug ("Switching op for action==\"{$_GET['action']}\", op==\"{$_GET['op']}\"");
	switch($_GET['action']) {
		case 'users':
			if(verify_level(3) && verify_permission('users')) {
				require_once('admin_user_func.php');
				switch($_GET['op']) {
					case 'add':
						$content .= admin_user_add();
						break;
					case 'list':
						$content .= admin_user_view_accounts();
						break;
					case 'edit':
						$content .= admin_user_edit();
						break;
					case 'delete':
						$content .= admin_user_delete();
						break;
					case 'permissions':
						$content .= admin_user_permissions();
						break;
					default:
						$content .= admin_user_nav();
						break;
				}
			}
			else{
				$content .='I\'m sorry but you do not have the appropriate access level to view this page.';
			}
			break;
		case 'modules':
			if(verify_level(3)) {
				require_once('modules_func.php');
				switch ($_GET['op']) {
					
					case 'test':
						$content = test();
						break;
					
					case 'cli':
						$content = mod_server_cli();
						break;
					
					case 'list_modules':
						$content = modules_list_modules();
						break;
						
					case 'view_module_info':
						$content = modules_view_module_info($_GET['mod_id']);
						break;
					
					case 'modules_wait_download':
						$content = modules_wait_download();
						break;
				
					case 'download_modules_menu':
						$content = modules_download_modules_menu();
						break;
						
					case 'view_remote_module_info':
						$content = modules_view_remote_module_info($_GET['mod_id']);
						break;
						
					case 'install_remote_module':
						$content = modules_install_remote_module($_GET['mod_id']);
						break;
				
					default:
						$menu = array (
						#"base:Server Messages:admin.php?action=modules&op=server_messages:images/cynus_icon.png",
						"base:List Installed Modules:admin.php?action=modules&op=list_modules:images/cynus_icon.png",
						#"base:Check for Cynus Upgrade:admin.php?action=modules&op=check_upgrade:images/cynus_icon.png",
						"base:Install Modules:admin.php?action=modules&op=download_modules_menu:images/cynus_icon.png",
						"base:Remove Modules:admin.php?action=modules&op=remove_mod_menu:images/cynus_icon.png",
						"base:Unofficial/Manual<br />Module Installation:admin.php?action=modules&op=install_mod_menu:images/cynus_icon.png",
						"base:Upgrade Cynus:admin.php?action=modules&op=upgrade_cynus_menu:images/cynus_icon.png",
						);
						$content = cynus_menu($menu, base);
						break;					
				}
			}
			break;
		
		case 'config':
			if(verify_level(4) && verify_permission('config')) {
				require_once('admin_config_func.php');
				switch($_GET['op']) {
					case 'edit':
						$content .= config_edit_section();
						break;
					default:
						$content.=config_list_sections();
						break;
				}
			}
			else{
				$content .='I\'m sorry but you do not have the appropriate access level to view this page.';
			}
			break;
		
		default:
			set_page_title('Administrative Section');
			cynus_debug ("Fell through the action switch for action==\"{$_GET['action']}\"", 2);
			$content='This is the admin section, yay!';
			break;
	}
}

#now print out the page
do_header();
print $content;
do_footer();

#and now...
exit;

?>
Return current item: Cynus