diff --git a/Scripts/centos-web/admin/content.php b/Scripts/centos-web/admin/content.php new file mode 100644 index 0000000..a2b05ca --- /dev/null +++ b/Scripts/centos-web/admin/content.php @@ -0,0 +1,187 @@ + 'index.php') + { + echo '

Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

'; + exit; + } + +//-----------/* Sanitize URL variables */ + + foreach ( $_GET as $key => $value ) + { + if ( sanitize_url_var($key) ) + { + $url[$key] = $value; + } + } + +//----------/* Page Selector */ + + if ( isset( $url['page'] ) ) + { + switch ( $url['page'] ) + { + case 'entries': + /* Build relation between "Entries" sublinks and its pages */ + if ( isset($url['action'] ) ) + { + switch ( $url['action'] ) + { + case "add": + $page = 'p_entries_add.php'; + break; + + case "update": + $page = 'p_entries_update.php'; + break; + } + } + else + { + $page = 'p_entries.php'; + } + break; + + case 'pages': + // Just if user has admin rights. + if ( is_user('administrator') ) + { + /* Build relation between "Pages" sublinks and its pages */ + if ( isset($url['action'] ) ) + { + switch ( $url['action'] ) + { + case 'add': + $page = 'p_pages_add.php'; + break; + + case 'update': + $page = 'p_pages_update.php'; + break; + } + } + else + { + $page = 'p_pages.php'; + } + } + break; + + case 'categories': + // Just if user has admin rights. + if ( is_user('administrator') ) + { + /* Build relation between "Categories" sublinks and its pages */ + if ( isset($url['action'] ) ) + { + switch ( $url['action'] ) + { + case 'add': + $page = 'p_categories_add.php'; + break; + case 'update': + $page = 'p_categories_update.php'; + break; + case 'tree': + $page = 'p_categories_tree.php'; + break; + } + } + else + { + $page = 'p_categories.php'; + } + } + break; + + case 'comments': + // Just if user has admin rights. + if ( is_user('administrator') ) + { + /* Build relation between "Links" sublinks and its pages */ + if ( isset($url['action'] ) ) + { + switch ( $url['action'] ) + { + case 'add': + $page = 'p_comments_add.php'; + break; + case 'update': + $page = 'p_comments_update.php'; + break; + } + } + else + { + $page = 'p_comments.php'; + } + } + break; + + case 'links': + // Just if user has admin rights. + if ( is_user('administrator') ) + { + /* Build relation between "Links" sublinks and its pages */ + if ( isset($url['action'] ) ) + { + switch ( $url['action'] ) + { + case 'add': + $page = 'p_links_add.php'; + break; + } + } + else + { + $page = 'p_links.php'; + } + } + break; + + case 'users': + // Just if user has admin rights. + if ( is_user('administrator') ) + { + /* Build relation between "Links" sublinks and its pages */ + if ( isset($url['action'] ) ) + { + switch ( $url['action'] ) + { + case 'add': + $page = 'p_users_add.php'; + break; + } + } + else + { + $page = 'p_users.php'; + } + } + break; + + default: + $page = 'p_index.php'; + break; + } + } + else + { + $page = 'p_index.php'; + } + +//--------/* Verify file before include it + + if ( file_exists( ABSPATH . 'admin/' . $page ) ) + { + include (ABSPATH . 'admin/' . $page ); + } +?> diff --git a/Scripts/centos-web/admin/footer.php b/Scripts/centos-web/admin/footer.php new file mode 100644 index 0000000..8b06438 --- /dev/null +++ b/Scripts/centos-web/admin/footer.php @@ -0,0 +1,35 @@ + 'index.php') + { + echo '

Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

'; + exit; + } +?> + + + + + + + + + diff --git a/Scripts/centos-web/admin/header.php b/Scripts/centos-web/admin/header.php new file mode 100644 index 0000000..6cbcc7a --- /dev/null +++ b/Scripts/centos-web/admin/header.php @@ -0,0 +1,50 @@ + 'index.php') + { + echo '

Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

'; + exit; + } +?> + + + + + + Admin :: <?php echo HTML_TITLE ?> + + + + + + + +
+ +
+ diff --git a/Scripts/centos-web/admin/img/header-background.png b/Scripts/centos-web/admin/img/header-background.png new file mode 100755 index 0000000..ff2a7b0 Binary files /dev/null and b/Scripts/centos-web/admin/img/header-background.png differ diff --git a/Scripts/centos-web/admin/img/html-background.png b/Scripts/centos-web/admin/img/html-background.png new file mode 100755 index 0000000..30f7d70 Binary files /dev/null and b/Scripts/centos-web/admin/img/html-background.png differ diff --git a/Scripts/centos-web/admin/img/moin-msg-bg-blue.png b/Scripts/centos-web/admin/img/moin-msg-bg-blue.png new file mode 100755 index 0000000..7a816cf Binary files /dev/null and b/Scripts/centos-web/admin/img/moin-msg-bg-blue.png differ diff --git a/Scripts/centos-web/admin/img/moin-msg-bg-gray.png b/Scripts/centos-web/admin/img/moin-msg-bg-gray.png new file mode 100755 index 0000000..43d1a55 Binary files /dev/null and b/Scripts/centos-web/admin/img/moin-msg-bg-gray.png differ diff --git a/Scripts/centos-web/admin/img/moin-msg-bg-green.png b/Scripts/centos-web/admin/img/moin-msg-bg-green.png new file mode 100755 index 0000000..f4ca7ca Binary files /dev/null and b/Scripts/centos-web/admin/img/moin-msg-bg-green.png differ diff --git a/Scripts/centos-web/admin/img/moin-msg-bg-orange.png b/Scripts/centos-web/admin/img/moin-msg-bg-orange.png new file mode 100755 index 0000000..25a57b5 Binary files /dev/null and b/Scripts/centos-web/admin/img/moin-msg-bg-orange.png differ diff --git a/Scripts/centos-web/admin/img/moin-msg-bg-red.png b/Scripts/centos-web/admin/img/moin-msg-bg-red.png new file mode 100755 index 0000000..2dfcf09 Binary files /dev/null and b/Scripts/centos-web/admin/img/moin-msg-bg-red.png differ diff --git a/Scripts/centos-web/admin/img/moin-msg-bg-violet.png b/Scripts/centos-web/admin/img/moin-msg-bg-violet.png new file mode 100755 index 0000000..657824d Binary files /dev/null and b/Scripts/centos-web/admin/img/moin-msg-bg-violet.png differ diff --git a/Scripts/centos-web/admin/img/ul.png b/Scripts/centos-web/admin/img/ul.png new file mode 100755 index 0000000..fd89ccd Binary files /dev/null and b/Scripts/centos-web/admin/img/ul.png differ diff --git a/Scripts/centos-web/admin/img/ul2.png b/Scripts/centos-web/admin/img/ul2.png new file mode 100644 index 0000000..467b107 Binary files /dev/null and b/Scripts/centos-web/admin/img/ul2.png differ diff --git a/Scripts/centos-web/admin/includes/classes/db_postgresql.php b/Scripts/centos-web/admin/includes/classes/db_postgresql.php new file mode 100644 index 0000000..515493a --- /dev/null +++ b/Scripts/centos-web/admin/includes/classes/db_postgresql.php @@ -0,0 +1,64 @@ + + * @copyright 2009 - CentOS Artwork SIG. + * @license GPL + */ + +class DB_PostgreSQL +{ + + var $dbconn; + +//---- Initialize class + + function __construct() + { + $conn_string = 'user=' . DB_USERNAME . ' password=' . DB_PASSWORD . ' dbname=' . DB_DBNAME; + $this->dbconn = pg_connect($conn_string) or die("Could not connect"); + } + +//---- Am I connected ? + + function check_connection() + { + if (pg_connection_status($this->dbconn) === PGSQL_CONNECTION_OK ) + { + return translate('connected'); + } + else + { + return translate('disconnected'); + } + + } + +//---- Query + + function query( $sql_string ) + { + $result = pg_query( $this->dbconn, $sql_string ); + + return $result; + } + +//---- Class Destructor + + function __destruct() + { + + if (pg_connection_status($this->dbconn)) + { + pg_close($this->dbconn); + } + + } + +} + +$db = new DB_PostgreSQL; +?> diff --git a/Scripts/centos-web/admin/includes/classes/ldap.php b/Scripts/centos-web/admin/includes/classes/ldap.php new file mode 100644 index 0000000..5fe83f3 --- /dev/null +++ b/Scripts/centos-web/admin/includes/classes/ldap.php @@ -0,0 +1,572 @@ + + * @copyright 2009 - CentOS Artwork SIG. + * @license GPL + */ + +class LDAP +{ + + var $ldapconn; + var $ldapbind; + + // LDAP Filter Attributes + var $filter_attrb = array(); + var $filter_type = array(); + var $filter_clean = array(); + +//-----------/* Class initializations + + function __construct() + { + // Open connection against ldap server + $this->ldapconn = ldap_connect(LDAP_HOST,LDAP_PORT) or die("Could not connect to " . LDAP_HOST . "."); + + // Set protocol version to use + ldap_set_option($this->ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3) or die("Could not connect to server through LDAPv3."); + + // Bind + $this->ldapbind = ldap_bind( $this->ldapconn, LDAP_ROOTDN, LDAP_ROOTPW ); + + // Initialize ldap filter attributes + $this->filter_attrb['cn'] = 'cn'; + $this->filter_attrb['uid'] = 'uid'; + $this->filter_attrb['employeetype'] = ucfirst(translate('employeetype')); + $this->filter_attrb['preferredlanguage'] = ucfirst(translate('language')); + + // Initialize ldap filter Types + $this->filter_type['='] = '='; + $this->filter_type['~='] = '~='; + + // Initialize ldap filter default + $this->filter_clean['attrb'] = 'preferredlanguage'; + $this->filter_clean['type'] = '='; + $this->filter_clean['value'] = LANGUAGE; + } + +//----------- Get entries from ldap server + + function get_entries( $filter ) + { + // Return entries just if filter valid + $search = ldap_search($this->ldapconn,LDAP_DN,$filter); + $entries = ldap_get_entries($this->ldapconn,$search); + return $entries; + } + +//----------// Validate filter value input + // Sanitize filter pattern - Attributes + + function is_valid( $name , $value ) + { + switch ( $name ) + { + case 'uid': + $pattern = '/^([a-z0-9_]|\-|\.)+@(([a-z0-9_]|\-)+\.)+([a-z]{2,6})?$/'; + break; + + case 'preferredlanguage': + $pattern = '/^[a-zA-Z]{2}$/'; + break; + + case 'filtertype': + $pattern = '/^(=|~=)$/'; + break; + + case 'employeetype': + $pattern = '/^(writer|administrator)$/'; + break; + + default: + $pattern = '/^[a-zA-Z0-9_áéíóñúàçèé ]+$/'; + break; + } + + if ( isset( $pattern ) && preg_match( $pattern , $value )) + { + return true; + } + else + { + return false; + } + } + +//---------- Check filter attributes */ + + function sanitize_filter_attribute() + { + $dirty = array(); + $clean = array(); + + // Initialize dirty attribute + $dirty['attrb'] = $this->filter_clean['attrb']; + + // Initialize clean attribute + $clean['attrb'] = $this->filter_clean['attrb']; + + // Recover dirty attribute values from filter form + if ( isset( $_POST['attribute'] ) ) + { + $dirty['attrb'] = $_POST['attribute']; + } + + // Check dirty attribute + if ( array_key_exists( $dirty['attrb'], $this->filter_attrb ) ) + { + // Attribute is not dirty any more. It passed validation. + $clean['attrb'] = $dirty['attrb']; + } + + return $clean['attrb']; + } + +//---------- Check filter types + + function sanitize_filter_type() + { + $dirty = array(); + $clean = array(); + + $dirty['type'] = $this->filter_clean['type']; + $clear['type'] = $this->filter_clean['type']; + + // Recover dirty type values from filter form + if ( isset( $_POST['type'] ) ) + { + $dirty['type'] = $_POST['type']; + } + else + { + $dirty['type'] = $this->filter_clean['type']; + } + + // Check dirty types + if ( array_key_exists( $dirty['type'], $this->filter_type ) ) + { + // Type is not dirty any more. It passed validation. + $clean['type'] = $dirty['type']; + } + + return $clean['type']; + } + +//---------- Sanitize filter value + + function sanitize_filter_value() + { + $dirty = array(); + $clean = array(); + + $dirty['value'] = $this->filter_clean['value']; + $clean['value'] = $this->filter_clean['value']; + + // Recover dirty value from filter form + if ( isset( $_POST['value'] ) ) + { + $dirty['value'] = $_POST['value']; + } + + // Sanitize dirty value, based on supplied attribe + $name = $this->sanitize_filter_attribute(); + $value = $dirty['value']; + + if ( $this->is_valid( $name, $value ) ) + { + // Value is not dirty any more. It passed validation. + $clean['value'] = $value; + } + + return $clean['value']; + } + +//---------- Build ldap form filter + + function show_filter() + { + $clean = array(); + + $clean['attrb'] = $this->sanitize_filter_attribute(); + $clean['type'] = $this->sanitize_filter_type(); + $clean['value'] = $this->sanitize_filter_value(); + + // Start html form + $html = '
'; + $html .= '
'; + + // Build html form fileds. Start with some text + $html .= ucfirst(translate('filtering by')) . ': '; + + // Build attributes' select form field + $html .= get_user_attrSelector(); + + // Build types' select form field + $html .= ''; + + // Build value's text form field + $html .= ''; + + // Build submit form button + $html .= ''; + + // End html form + $html .= '
'; + $html .= '
'; + + return $html; + } + +//---------- Build ldap filter string + + function build_filter_string() + { + $clean['attrb'] = $this->sanitize_filter_attribute(); + $clean['type'] = $this->sanitize_filter_type(); + $clean['value'] = $this->sanitize_filter_value(); + + return $clean['attrb'] . $clean['type'] . $clean['value']; + + } + +//----------- Check uniqueness of uid attribute */ + + function is_uid_present( $uid ) + { + // Verify that uid entry's value be unique + $filter = 'uid=' . $uid; + $entry = $this->get_entries($filter); + + if ( $uid != '' && $entry['count'] == 1 ) + { + return true; + } + else + { + return false; + } + } + +//---------- Prepare userPassword + + function prepare_userpassword( $userpassword ) + { + $dirty['userpassword'] = $userpassword; + + switch ( LDAP_PASSHASH ) + { + case '{MD5}': + $clean['userpassword'] = LDAP_PASSHASH . base64_encode( pack( 'H*', md5( $dirty['userpassword'] ) ) ); + break; + + case '{SHA}': + $clean['userpassword'] = LDAP_PASSHASH . base64_encode( pack( 'H*', sha1( $dirty['userpassword'] ) ) ); + break; + } + + return $clean['userpassword']; + } + +//-----------/* Verify modifiable attributes + /* Description : Generally used to redifine entry's input keys and values, + /* based on is_valid() */ + /* $entry : is an array with entry's keys and values. */ + + function sanitize_entry( $entry ) + { + // Define attributes that can be modified + $fields = array('uid', 'cn','userpassword','displayname','preferredlanguage','employeetype'); + + // Verify and validate entry's attributes + foreach ( $fields as $key ) + { + if ( isset( $entry[$key] ) && $this->is_valid( $key, $entry[$key] ) ) + { + // Values that reach this point may be concider "clean". + $clean['entry'][$key] = $entry[$key]; + } + } + + // Return clean entry array or false + if ( isset( $clean['entry'] ) && is_array( $clean['entry'] ) ) + { + return $clean['entry']; + } + else + { + return false; + } + } + +//----------/* Initialize useradd values. + /* Description: Used in the useradd form page to initiate form values. + /* $attribute : is an array with the related attributes to check. */ + + function init_useradd_values( $attributes ) + { + foreach ( $attributes as $key ) + { + if ( ! isset( $_POST[$key] ) ) + { + $entry[$key] = ''; + } + else + { + if ( isset( $_POST[$key] ) && $this->is_valid($key, $_POST[$key]) ) + { + $entry[$key] = $_POST[$key]; + } + else + { + $entry[$key] = ''; + } + } + } + return $entry; + } + +//----------/* Initialize useradmin values and do action if submited + /* values are different from the actual one. + /* Description: used in the p_users.php to initiate form values. + /* $id : is the name of the form identification. + /* $attribute : is an array with the related attributes to check. */ + + function init_useradmin_values( $entry, $attributes, $action ) + { + + // First loop to match b in x[b] + for ($i = 0; $i < $entry['count']; $i++) + { + if ( isset( $_POST['uid'][$i] )) + { + // Define entry id + $entry_new['uid'] = $entry[$i]['uid'][0]; + + // Initialize entry cn + // Needed to update sn in the background. + $entry_new['cn'] = $entry[$i]['cn'][0]; + + // Second loop to match x in x[b] + foreach ( $attributes as $key ) + { + // Reset entry value based on input + if ( isset( $_POST[$key][$i] ) ) + { + // Check it is a valid value + if ( $this->is_valid( $key, $_POST[$key][$i] ) ) + { + // ... and that it is different from the actual one + if ( $_POST[$key][$i] != $entry[$i][$key][0] ) + { + + $entry_new[$key] = $_POST[$key][$i]; + + // Prepare userPassword. + // SECURITY: this attribute value should never + // be verified with the previous one. If + // verification is done you are providing a + // way to "guess" the user password by trying + // passwords until someone reject to update. + // Not to critic but if you guess it at the + // first try ;). Keep it unverifiable please. + if ( $key == 'userpassword' ) + { + $newpasswd = $this->prepare_userpassword($_POST[$key][$i]); + $entry_new[$key] = $newpasswd; + } + } + } + } + } + } + + // Do action if pressent + if ( isset( $entry_new ) ) + { + $message = $this->do_action( $entry_new, $action ); + } + else + { + $message = show_message(ucfirst(translate('nothing to do')), 'orange'); + } + } + + return $message; + } + +//-----------/* Do actions (udpate|delete|add) + /* $entry : is an array with the entry's key and value information. + /* $action : is an string telling what to do with the $entry. + /* Description : Actions are applied to just one entry at the same time. */ + /* The returned value is a message telling what happend with + the action requested.*/ + + function do_action( $entry, $action ) + { + // Define Entry's DN + if ( isset( $entry['uid'] ) && $this->is_valid( 'uid', $entry['uid'] ) ) + { + $dn = 'uid=' . $entry['uid'] . ',' . LDAP_DN; + } + else + { + $message = show_message(ucfirst(translate('a valid uid is required')),'orange'); + return $message; + } + + // Define possible actions + $possible_actions = '/^(add|update|delete)$/'; + if ( ! preg_match( $possible_actions, $action ) ) + { + // There is nothing to do here so exit to finish action intention. + $message = show_message(ucfirst(translate('invalid action')), 'red'); + return $message; + } + + // Define what to do in each action's case + switch ( $action ) + { + case 'update': + + // If there are valid values then do the update action. + if ( is_array( $entry ) ) + { + // Update sn attribute + $entry['sn'] = preg_replace('/^([a-zA-Z0-9_]+ ?)/','', $entry['cn']); + if ( $entry['sn'] == '' ) + { + $message = show_message(ucfirst(translate('invalid cn')), 'orange'); + return $message; + } + + if (ldap_modify($this->ldapconn, $dn, $entry)) + { + $message = show_message(ucfirst(translate('data was updated successfully')), 'green'); + } + else + { + $message = show_message(ucfirst(translate('data was not updated')), 'orange'); + } + } + break; + + // Delete Entry + case 'delete': + + // Delete Entry + if ( is_array( $entry ) ) + { + if ( ldap_delete( $this->ldapconn, $dn ) ) + { + $message = show_message(ucfirst(translate('data was deleted successfully')), 'green'); + } + else + { + $message = show_message(ucfirst(translate('data was not deleted')), 'orange'); + } + } + break; + + // Add Entry + case 'add': + + // Verify uid presence + if ( $this->is_uid_present( $entry['uid'] ) ) + { + // Abort this action commitment. + $message = show_message(ucfirst(translate('user identifier already exists')), 'orange'); + return $message; + } + + // Define and validate required attributes + $require_attrs = array('uid', 'userpassword', 'cn', 'displayname', 'preferredlanguage', 'employeetype'); + foreach ( $require_attrs as $key ) + { + if ( !isset($entry[$key]) || ! $this->is_valid($key, $entry[$key])) + { + $message = show_message(ucfirst(translate('the field')) .' '. translate($key) .' ' . translate('requires a valid value') , 'orange'); + return $message; + } + } + + // Prepare userPassword and other attributes. + $entry['userpassword'] = $this->prepare_userpassword($entry['userpassword']); + $entry['objectclass'] = 'inetOrgPerson'; + $entry['sn'] = preg_replace('/^([a-zA-Z0-9_]+ ?)/','', $entry['cn']); + if ( $entry['sn'] == '' ) + { + $message = show_message(ucfirst(translate('invalid cn')), 'orange'); + return $message; + } + $entry['mail'] = $entry['uid']; + + // If there are valid values then do the add action. + if ( ldap_add( $this->ldapconn, $dn, $entry ) ) + { + $message = show_message(ucfirst(translate('user added successfully')), 'green'); + } + else + { + $message = show_message(ucfirst(translate('user was not added')), 'orange'); + } + break; + } + + return $message; + } + +//-------------------/* Rename entry dn */ + + function rename_dn( $olddn, $newdn, $newparent, $deleteoldrdn ) + { + ldap_rename($this->ldapconn, $olddn, $newdn, $newparent, $deleteoldrdn ); + + return true; + } + +//-----------/* Display useradmin information + /* Description : Used in p_users.php + /* $entries : is an array with the entries' keys and values. */ + + function show_useradmin_info( $entries ) + { + $html = ''; + + return $html; + } + +//-------------------/* Close connection */ + + function __destruct() + { + if ( isset( $this->ldapconn ) ) + { + ldap_unbind( $this->ldapconn ); + } + } + +} + +$ldap = new LDAP; +?> diff --git a/Scripts/centos-web/admin/includes/functions/auth.php b/Scripts/centos-web/admin/includes/functions/auth.php new file mode 100644 index 0000000..1b1279f --- /dev/null +++ b/Scripts/centos-web/admin/includes/functions/auth.php @@ -0,0 +1,140 @@ + + * @copyright 2009 - CentOS Artwork SIG. + * @license GPL + */ + +//--------------Authentication stuff-------------- + + session_start(); + +//--------------/* Verify Admin access rights */ + + function check_adminaccess() + { + /* Verify session */ + if (!isset($_SESSION['employeetype'])) + { + header('Location: '. BASEURL .'admin/login.php'); + } + } + + /* Check User Access */ + function check_useraccess() + { + $timeout = 60 * 30; // In seconds, i.e. 30 minutes. + $fingerprint = md5($_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']); + $redirect_to = BASEURL . 'admin/login.php?loggedout=true'; + + /* Destroy session if ... */ + if (isset($_SESSION['last_active']) && $_SESSION['last_active'] < (time()-$timeout) + || (isset($_SESSION['fingerprint']) && $_SESSION['fingerprint']!=$fingerprint) + || isset($_GET['action']) && $_GET['action'] == 'logout') + { + + setcookie(session_name(), '', time()-3600, '/'); + session_destroy(); + header("Location: $redirect_to"); + } + + /* Regenerate session */ + session_regenerate_id(); + + /* Increase session lifetime */ + $_SESSION['last_active'] = time(); + + /* Rebuild session fingerprint */ + $_SESSION['fingerprint'] = $fingerprint; + + } + + /* Verify username and password */ + function login() + { + require_once(ABSPATH . 'admin/includes/classes/ldap.php'); + $ldap = new LDAP; + + /* Inicialize variables */ + $login = array(); + $login['username'] = ''; + $login['password'] = ''; + + /* Validate username input */ + if (isset($_POST['username'])) + { + $mail_pattern = '/^([a-z0-9+_]|\-|\.)+@(([a-z0-9_]|\-)+\.)+[a-z]{2,6}$/'; + if (preg_match( $mail_pattern,$_POST['username'])) + { + $login['username'] = $_POST['username']; + } + } + + /* Validate password input */ + if (isset($_POST['password'])) + { + $login['password'] = $ldap->prepare_userpassword($_POST['password']); + } + + /* Query LDAP directory looking for username AND password */ + $search = $ldap->get_entries('(&(uid=' . $login['username'] . ')(&(userpassword=' . $login['password'] . ')))'); + + /* Build user's session if match */ + if ($search['count'] == 1) + { + /* Set session information */ + $_SESSION['uid'] = $search[0]['uid'][0]; + $_SESSION['cn'] = $search[0]['cn'][0]; + $_SESSION['employeetype'] = $search[0]['employeetype'][0]; + + /* Set session lasttime access */ + $_SESSION['last_active'] = time(); + + /* Set session fingerprint */ + $fingerprint = md5($_SERVER['REMOTE_ADDR'].$_SERVER['HTTP_USER_AGENT']); + $_SESSION['fingerprint'] = $fingerprint; + + /* Redirect to frontpage */ + header("Location: " . BASEURL); + + return 0; + } + else if ($search['count'] > 1) + { + // Login Failed: There are duplicates in the ldap directory database + return 002; + } + else + { + // Login Failed: There is no coincidece in the search + return '001'; + } + } + + // User links + function get_auth_userlinks() + { + + $html = '' . "\n"; + + return $html; + + } + +?> diff --git a/Scripts/centos-web/admin/includes/functions/categories.php b/Scripts/centos-web/admin/includes/functions/categories.php new file mode 100644 index 0000000..a6ebe11 --- /dev/null +++ b/Scripts/centos-web/admin/includes/functions/categories.php @@ -0,0 +1,363 @@ +query( $sql_string ); + $category = pg_fetch_array($source); + + if ( ! $category['name'] ) + { + $category['name'] = 'No'; + } + } + + return $category['name']; +} + +//-------/* Get Admin Categories Selector + /* (used in category administration) */ + +function get_category_selector( $category_id = null, $category_parent_id = null, $type = 'insert' ) +{ + global $db; + + $sql_string = "SELECT id, name, parent FROM categories;"; + $rows = $db->query( $sql_string ); + + $html = ''; + + return $html; +} + +//-------/* Get Admin Categories Form + +function get_categories_admin_form( $rows ) +{ + $html = '
'; + $html .= '
'; + $html .= show_action_field('delete'); + $html .= ''; + $html .= '
'; + + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + + // Loop throuh rows + while ( $row = pg_fetch_array($rows) ) + { + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + } + + $html .= '
' . ucfirst(translate('name')) . '' . ucfirst(translate('parent category')) . '' . ucfirst(translate('description')) . '
'.$row['name'].''. get_category_name($row['id']) .''.$row['description'].'
'; + + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + + return $html; +} + +//-------/* Get Add Categories Form + +function get_categories_add_form() +{ + $html = '
'; + $html .= '
'; + $html .= '
    '; + $html .= '
  • ' . translate('Name') . '
  • '; + $html .= '
  • '; + $html .= '
  • ' . ucfirst( translate('parent category') ) . '
  • '; + $html .= '
  • ' . get_category_selector() . '
  • '; + $html .= '
  • ' . translate('Description') . '
  • '; + $html .= '
  • '; + $html .= '
  • '; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + + return $html; +} + +//-------/* Get Update Categories Form + +function get_categories_update_form() +{ + global $db; + + if ( sanitize_url_var( 'id' ) ) + { + $clean['id'] = $_GET['id']; + $sql_string = "SELECT id, name, parent, description FROM categories WHERE id=" . $clean['id'] . ";"; + $row = $db->query( $sql_string ); + + if ( $row !== false ) + { + $row = pg_fetch_array($row); + + $html = '
'; + $html .= '
'; + $html .= '
    '; + $html .= '
  • ' . translate('Name') . '
  • '; + $html .= '
  • '; + $html .= '
  • ' . ucfirst(translate('parent category')) . '
  • '; + $html .= '
  • '. get_category_selector( $row['id'], $row['parent'], 'update').'
  • '; + $html .= '
  • ' . translate('Description') . '
  • '; + $html .= '
  • '; + $html .= '
  • '; + $html .= '
'; + $html .= ''; + $html .= '
'; + $html .= '
'; + } + else + { + $html = show_message( ucfirst( translate("the category doesn't exist") ) , 'orange'); + } + } + else + { + $html = show_message( ucfirst( translate('nothing to do') ) , 'orange'); + } + + return $html; +} + +//-------/* Administrate Categories + +function admin_categories() +{ + global $db; + + $fields = array('id', 'name', 'parent', 'description'); + $counter = 0; + + // Define action to do + if (isset($_POST['action']) && preg_match('/^(update|delete|add)$/', $_POST['action'])) + { + $action = $_POST['action']; + + switch ( $action ) + { + case 'update': + + // Initialize FORM variables + foreach ( $fields as $key ) + { + if ( isset( $_POST[$key] ) && $_POST[$key] != '' ) + { + $clean[$key] = pg_escape_string($_POST[$key]); + } + else + { + $clean[$key] = ''; + } + } + + + // Required fields + if ( $clean['name'] == '' ) + { + $message = show_message(ucfirst(translate('field name can not be empty')),'orange'); + return $message; + } + + // Verify and redifine category indentification + if ( sanitize_url_var( 'id' ) ) + { + $clean['id'] = $_GET['id']; + } + + + // Build sql string for updating + $sql_string = "UPDATE categories SET name='" . $clean['name'] . "', description='" . $clean['description'] . "' WHERE id=" . $clean['id'] . ";"; +echo $sql_string; + // Execute UPDATE action + $db->query( $sql_string ); + + // Define message for successful action + $message = show_message( ucfirst( translate('data was updated successfully' ) ), 'green'); + + break; + + case 'delete': + + if ( isset( $_POST['id'] ) ) + { + foreach ( $_POST['id'] as $key ) + { + if ( preg_match( '/^[0-9]+$/', $key ) ) + { + // Check for dependencies for actual category id + // ... + + // Build SQL string for deleting + $sql_string = "DELETE FROM categories WHERE id=" . $key . ";"; + + // Execute DELETE action + if ( $db->query( $sql_string ) ) + { + $counter++; + } + } + else + { + // Build message for failed action + $message = show_message(ucfirst(translate('id value is incorrect'))); + return $message; + } + } + + // Build message for successful action (with plural distinction) + if ( $counter > 1 ) + { + $message = $counter . ' ' . translate('records deleted successfully'); + } + else + { + $message = $counter . ' ' . translate('record deleted successfully'); + } + $message = show_message( $message, 'green'); + } + break; + + case 'add': + + $fields = array('name', 'parent', 'description'); + + // Initialize and prepare input values for db insertion + foreach ( $fields as $key) + { + if ( isset( $_POST[$key] ) ) + { + $clean[$key] = pg_escape_string($_POST[$key]); + } + else + { + $clean[$key] = ''; + } + } + + // Required fields + if ( $clean['name'] == '' ) + { + $message = show_message(ucfirst(translate('field name can not be empty')),'orange'); + return $message; + } + + // Build sql string for inserting + $sql_string = "INSERT INTO categories (name, parent, description) + VALUES ('".$clean['name']."', '" . $clean['parent']. "', '" .$clean['description']."');"; + + // Execute INSERT action + if ( $db->query( $sql_string ) ) + { + // Build message for successful action + $message = show_message(ucfirst(translate('category was added successfully')),'green'); + } + else + { + // Build message for failed action + $message = show_message(ucfirst(translate('category was not added')),'orange'); + } + break; + } + + // Define default informative message if no action is present + if ( ! isset( $message ) ) + { + $message = show_message(ucfirst(translate('nothing to do')), 'orange'); + } + + // Return informative action message + return $message; + + } + + // Return false if no action is present + return false; +} + + +//--------/* Get Category Tree */ + +function get_category_tree( $parent = 0, $linkto = 'default' ) +{ + + global $db; + $sql_string = "SELECT id, name, parent FROM categories WHERE parent = ". $parent ." ORDER BY name;"; + $categories = $db->query($sql_string); + $html = ''; + + $html .= ''; + + return $html; +} diff --git a/Scripts/centos-web/admin/includes/functions/html.php b/Scripts/centos-web/admin/includes/functions/html.php new file mode 100644 index 0000000..187fad5 --- /dev/null +++ b/Scripts/centos-web/admin/includes/functions/html.php @@ -0,0 +1,47 @@ +'; + $html .= $message; + $html .= '
'; + + return $html; + } + +//-------/* Show action selector form field + + function show_action_field( $action = 'default' ) + { + $html = ucfirst(translate('action')) . ': '; + + return $html; + + } +?> diff --git a/Scripts/centos-web/admin/includes/functions/links.php b/Scripts/centos-web/admin/includes/functions/links.php new file mode 100644 index 0000000..5546d8f --- /dev/null +++ b/Scripts/centos-web/admin/includes/functions/links.php @@ -0,0 +1,165 @@ +'; + + if ( isset($url['page'] ) ) + { + $html .= '
  • '. strtoupper(translate('home')) . '
  • '; + } + else + { + $html .= '
  • '. strtoupper(translate('home')) . '
  • '; + } + + foreach ($link as $key => $value) + { + if ( isset($url['page']) && $url['page'] == $key) + { + $value = translate(strtolower($key)); + $html .= '
  • ' . strtoupper($value). '
  • '; + } + else + { + $value = translate(strtolower($key)); + $html .= '
  • ' . strtoupper($value). '
  • '; + } + } + + $html .= ''; + + return $html; + } + +/*** + * Sublinks used in the administratoristration interface + * + * @param show_sublink(); + * @param control link visibility/availability. + */ + +function show_sublinks() +{ + +//-----------/* Initialize Link Array */ + + $link = array(); + + $link['entries'] = ucfirst(translate('entries')); + $link['pages'] = ucfirst(translate('pages')); + $link['categories'] = ucfirst(translate('categories')); + $link['links'] = ucfirst(translate('links')); + $link['users'] = ucfirst(translate('users')); + +//-----------/* Sanitize URL variables */ + + if ( sanitize_url_var('page') ) + { + $url['page'] = $_GET['page']; + } + +//-----------/* Build html links */ + + $html = ''; + + return $html; + } +?> diff --git a/Scripts/centos-web/admin/includes/functions/url.php b/Scripts/centos-web/admin/includes/functions/url.php new file mode 100644 index 0000000..570f521 --- /dev/null +++ b/Scripts/centos-web/admin/includes/functions/url.php @@ -0,0 +1,53 @@ + diff --git a/Scripts/centos-web/admin/includes/functions/users.php b/Scripts/centos-web/admin/includes/functions/users.php new file mode 100644 index 0000000..78abe8f --- /dev/null +++ b/Scripts/centos-web/admin/includes/functions/users.php @@ -0,0 +1,189 @@ + 'English', + 'es' => 'Español', + 'fr' => 'Français'); + + return $languages; + } + +//---------------------/* Determine user's role */ + + function is_user( $role ) + { + if ( $_SESSION['employeetype'] == $role ) + { + return true; + } + else + { + return false; + } + } + +//---------------------/* User Role-Selector */ + +function get_user_roleSelector( $id = '', $entry_value = '' ) +{ + $employeetypes = get_user_roles(); + + if ( ! is_int($id) ) + { + $html = ''; + } + + foreach ($employeetypes as $value ) + { + if ( $entry_value <> '' && $value == $entry_value ) + { + $html .= ''; + } + else + { + $html .= ''; + } + } + + $html .= ''; + + return $html; +} + +//---------------------/* User Attribute-Selector */ + +function get_user_attrSelector( $attr = '/(uid|cn|preferredlanguage|employeetype)/' ) +{ + global $ldap; + + $clean['attrb'] = $ldap->sanitize_filter_attribute(); + + $attributes = get_user_attributes(); + + $html = ''; + + return $html; +} + +//---------------------/* User Language-Selector */ + +function get_user_langSelector( $id = '', $entry_value = '' ) +{ + $languages = get_user_languages(); + + if ( isset($id) && is_int($id) ) + { + $html = ''; + } + + foreach ($languages as $key => $value ) + { + if ( ( $entry_value <> '' && $key == $entry_value ) || ( $id == '' && $entry_value == '' && $key == LANGUAGE ) ) + { + $html .= ''; + } + else + { + $html .= ''; + } + } + + $html .= ''; + + return $html; +} + +//-------/* Build useradd's form */ + +function show_useradd_form( $entry ) +{ + $html = '
    '; + $html .= '
    '; + + $html .= '
      '; + $html .= '
    • ' . ucfirst(translate('uid')) .':
    • '; + $html .= '
    • ' . ucfirst(translate('ex')) . '. john@example.com
    • '; + $html .= '
    • ' . ucfirst(translate('password')) . ':
    • '; + $html .= '
    • '; + $html .= '
    • '. ucfirst(translate('cn')) . ':
    • '; + $html .= '
    • '; + $html .= '
    • '. ucfirst(translate('displayname')) . ':
    • '; + $html .= '
    • '; + $html .= '
    • '. ucfirst(translate('preferredlanguage')) . ':
    • '; + $html .= '
    • ' . get_user_langSelector() . '
    • '; + $html .= '
    • ' . ucfirst(translate('employeetype')) . ':
    • '; + $html .= '
    • '. get_user_roleSelector() . '
    • '; + $html .= '
    • '; + $html .= '
    '; + + $html .= '
    '; + $html .= '
    '; + + return $html; +} + +//-------/* Show useradmin form + + function show_useradmin_form() + { + + + + } + +?> diff --git a/Scripts/centos-web/admin/index.php b/Scripts/centos-web/admin/index.php new file mode 100644 index 0000000..2f8814f --- /dev/null +++ b/Scripts/centos-web/admin/index.php @@ -0,0 +1,25 @@ + diff --git a/Scripts/centos-web/admin/login.php b/Scripts/centos-web/admin/login.php new file mode 100644 index 0000000..1a90302 --- /dev/null +++ b/Scripts/centos-web/admin/login.php @@ -0,0 +1,107 @@ + 0) + { + $message = '
    ' . ucfirst(translate($message)) . '
    '; + } + else + { + header('Location: index.php'); + } +} +?> + + + + + Admin :: <?php echo HTML_TITLE ?> + + + + + + + + + +
    + +
    + +

    + + '') {; echo $message; } ?> + +
    + + + + + + + + + + + + + +
    : (. john@example.com)
    :
    +
    + +
    +
    + + + + + + diff --git a/Scripts/centos-web/admin/p_categories.php b/Scripts/centos-web/admin/p_categories.php new file mode 100644 index 0000000..f6ef325 --- /dev/null +++ b/Scripts/centos-web/admin/p_categories.php @@ -0,0 +1,34 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } + +//----- Admin categories + + $message = admin_categories(); + +//----- Get Row + + $sql_string = "SELECT id, name, parent, description FROM categories ORDER BY name;"; + $rows = $db->query( $sql_string ); + +//----- Show action results + + if ( isset( $message ) ) + { + echo $message; + } +?> + + + +

    + +
    + +
    diff --git a/Scripts/centos-web/admin/p_categories_add.php b/Scripts/centos-web/admin/p_categories_add.php new file mode 100644 index 0000000..011261e --- /dev/null +++ b/Scripts/centos-web/admin/p_categories_add.php @@ -0,0 +1,26 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } + +//---- Do action and grab results + + if (isset($_POST['action'])) + { + $message = admin_categories(); + if (isset($message)) + { + echo $message; + } + } + +?> + +

    + + diff --git a/Scripts/centos-web/admin/p_categories_tree.php b/Scripts/centos-web/admin/p_categories_tree.php new file mode 100644 index 0000000..9745922 --- /dev/null +++ b/Scripts/centos-web/admin/p_categories_tree.php @@ -0,0 +1,15 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } + +?> + +

    + + diff --git a/Scripts/centos-web/admin/p_categories_update.php b/Scripts/centos-web/admin/p_categories_update.php new file mode 100644 index 0000000..77012ce --- /dev/null +++ b/Scripts/centos-web/admin/p_categories_update.php @@ -0,0 +1,26 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } + +//---- Do action and grab results + + if (isset($_POST['action'])) + { + $message = admin_categories(); + if (isset($message)) + { + echo $message; + } + } + +?> + +

    + + diff --git a/Scripts/centos-web/admin/p_comments.php b/Scripts/centos-web/admin/p_comments.php new file mode 100644 index 0000000..89270dc --- /dev/null +++ b/Scripts/centos-web/admin/p_comments.php @@ -0,0 +1,30 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } + +//----- Admin categories + + +//----- Get Row + + +//----- Show action results + + if ( isset( $message ) ) + { + echo $message; + } +?> + + + +

    + +
    +
    diff --git a/Scripts/centos-web/admin/p_entries.php b/Scripts/centos-web/admin/p_entries.php new file mode 100644 index 0000000..be30f7b --- /dev/null +++ b/Scripts/centos-web/admin/p_entries.php @@ -0,0 +1,11 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } +?> +

    diff --git a/Scripts/centos-web/admin/p_entries_add.php b/Scripts/centos-web/admin/p_entries_add.php new file mode 100644 index 0000000..dd9ab86 --- /dev/null +++ b/Scripts/centos-web/admin/p_entries_add.php @@ -0,0 +1,11 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } +?> +

    diff --git a/Scripts/centos-web/admin/p_entries_update.php b/Scripts/centos-web/admin/p_entries_update.php new file mode 100644 index 0000000..ae7d74f --- /dev/null +++ b/Scripts/centos-web/admin/p_entries_update.php @@ -0,0 +1,11 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } +?> +

    diff --git a/Scripts/centos-web/admin/p_index.php b/Scripts/centos-web/admin/p_index.php new file mode 100644 index 0000000..c609f84 --- /dev/null +++ b/Scripts/centos-web/admin/p_index.php @@ -0,0 +1,17 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } +?> +

    + + +

    + +

    Database Status: check_connection();?>

    +

    diff --git a/Scripts/centos-web/admin/p_links.php b/Scripts/centos-web/admin/p_links.php new file mode 100644 index 0000000..f0a3144 --- /dev/null +++ b/Scripts/centos-web/admin/p_links.php @@ -0,0 +1,11 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } +?> +

    diff --git a/Scripts/centos-web/admin/p_links_add.php b/Scripts/centos-web/admin/p_links_add.php new file mode 100644 index 0000000..bbdad5d --- /dev/null +++ b/Scripts/centos-web/admin/p_links_add.php @@ -0,0 +1,11 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } +?> +

    diff --git a/Scripts/centos-web/admin/p_pages.php b/Scripts/centos-web/admin/p_pages.php new file mode 100644 index 0000000..0266e00 --- /dev/null +++ b/Scripts/centos-web/admin/p_pages.php @@ -0,0 +1,11 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } +?> +

    diff --git a/Scripts/centos-web/admin/p_pages_add.php b/Scripts/centos-web/admin/p_pages_add.php new file mode 100644 index 0000000..9c5b616 --- /dev/null +++ b/Scripts/centos-web/admin/p_pages_add.php @@ -0,0 +1,11 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } +?> +

    diff --git a/Scripts/centos-web/admin/p_pages_update.php b/Scripts/centos-web/admin/p_pages_update.php new file mode 100644 index 0000000..11f1c32 --- /dev/null +++ b/Scripts/centos-web/admin/p_pages_update.php @@ -0,0 +1,12 @@ + 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } +?> + +

    diff --git a/Scripts/centos-web/admin/p_users.php b/Scripts/centos-web/admin/p_users.php new file mode 100644 index 0000000..2a37577 --- /dev/null +++ b/Scripts/centos-web/admin/p_users.php @@ -0,0 +1,134 @@ + + * Released under GPL lisence (http://www.fsf.org/licensing/licenses/gpl.txt) + */ + + +//-------------/* Show error if this page is called directly. + + if ( basename($_SERVER['PHP_SELF']) <> 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } + +//------------|* Define filter. + + $filter = $ldap->build_filter_string(); + +/*------------|* Initialize entry values. */ + + $entries = $ldap->get_entries( $filter ); + +/*------------|* Do Action if POST + * + * Description : Actions take place entry by entry. Just one + * entry at the same time. Actually two actions are supported + * (update,delete). */ + + if ( isset( $_POST['useradmin'] ) ) + { + // Define useradmin attributes. + $fields = array('cn', 'userpassword', 'displayname', 'preferredlanguage', 'employeetype'); + + // Recover action to do. + $action = $_POST['action']; + + // Reinitialize entries values based on input and do action if present + $message = $ldap->init_useradmin_values( $entries, $fields, $action ); + + + // Reload entry value to reflect changes immediately + $entries = $ldap->get_entries( $filter ); + } + +//------------/* Display useradmin action results + + if ( isset( $message ) ) + { + echo $message; + } + +//------------/* Display useradmin title + + echo '

    ' . ucfirst(translate(strtolower('admin'))) . ' ' . translate(strtolower('users')) . '

    '; + +//------------/* Display useradmin form + +?> + +
    + +

    show_useradmin_info( $entries ) ?>

    + +
    + +
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + +
    + + + +
    + +
    diff --git a/Scripts/centos-web/admin/p_users_add.php b/Scripts/centos-web/admin/p_users_add.php new file mode 100644 index 0000000..ff49658 --- /dev/null +++ b/Scripts/centos-web/admin/p_users_add.php @@ -0,0 +1,49 @@ + + * Released under GPL lisence (http://www.fsf.org/licensing/licenses/gpl.txt) + */ + +//------------/* Show error if this page is called directly. + + if ( basename($_SERVER['PHP_SELF']) <> 'index.php') + { + echo '

    Sorry, this page can\'t be served directly. '; + echo 'Try this instead.

    '; + exit; + } + +//------------/* Initialize entry values. + + $fields = array('uid', 'userpassword', 'cn', 'employeetype', 'preferredlanguage', 'displayname'); + $entry = $ldap->init_useradd_values( $fields ); + +//------------/* Do Action if POST + + if ( isset( $_POST['useradd'] ) ) + { + $message = $ldap->do_action( $entry, 'add' ); + } + +//------------/* Display useradd action results + + if ( isset($message) ) + { + echo $message; + } + +//------------/* Display useradd title + + echo '

    ' . ucfirst(translate('add')) . ' ' . translate('user') . '

    '; + +//------------/* Display useradd form + + echo show_useradd_form( $entry ); + +?> diff --git a/Scripts/centos-web/admin/style.css b/Scripts/centos-web/admin/style.css new file mode 100644 index 0000000..a99e426 --- /dev/null +++ b/Scripts/centos-web/admin/style.css @@ -0,0 +1,662 @@ +/*** + * Style used in some server responses. + * + * -- CentOS Artwork SIG. + * http://projects.centos.org/trac/artwork/wiki/WebServerCustomization + */ + +html { + background-color: #FFF; + background-image: url(img/html-background.png); + font-family: "DejaVu Sans", "Liberation Sans", sans-serif; + font-size: 0.85em; + line-height: 1.25em; + margin: 0 4% 0 4%; /* <- with 4% of left and right margin */ + } + +body { + background: #FFF; + border-width: 10px; + border-style: solid; + border-color: #FFF; + padding:0; + margin: 0; + } + +/* RSS */ + +#header .rss { + float:right; + padding: 0; + margin: 0; + margin-right: 1em; + border: none; +} + +/* Links */ + +a:link { text-decoration: none; color: #204C8D } +a:hover { text-decoration: underline; color: green; } +a:active { text-decoration: underline; color: green; } +a:visited { text-decoration: none; color: #204C8D; } +a:visited:hover { text-decoration: underline; color: green; } + +#footer .credits a:link { border-bottom: 1px dotted #eee; text-decoration: none; color: #eee } +#footer .credits a:hover { border-bottom: 1px dotted #eee; text-decoration: underline; color: #fff; } +#footer .credits a:active { border-bottom: 1px dotted #eee; text-decoration: underline; color: #eee; } +#footer .credits a:visited { border-bottom: 1px dotted #eee; text-decoration: none; color: #eee; } +#footer .credits a:visited:hover { border-bottom: 1px dotted #eee; text-decoration: underline; color: #fff; } + +#header .adminlinks a:link { border-bottom: 1px dotted #eee; text-decoration: none; color: #eee } +#header .adminlinks a:hover { border-bottom: 1px dotted #eee; text-decoration: underline; color: #fff; } +#header .adminlinks a:active { border-bottom: 1px dotted #eee; text-decoration: underline; color: #eee; } +#header .adminlinks a:visited { border-bottom: 1px dotted #eee; text-decoration: none; color: #eee; } +#header .adminlinks a:visited:hover { border-bottom: 1px dotted #eee; text-decoration: underline; color: #fff; } + +/* Alignment */ + +.floatr { float: right; } +.floatl { float: left; } +.alignr { text-align: right; } +.alignl { text-align: left; } +.alignc { text-align: center; } + +/* Lists */ + +#content ul, +#content ol { + padding-left: 1.9em; + margin-left: 3em; + margin-bottom: 1em; + } + +#content ul { + list-style: url("img/ul.png") circle; + } + +#content ol { + list-style-image: none !important; + } + +#content ul li { + padding-left: 0em; + margin-bottom: 0.3em; + } + +#content ol li { + padding-left: 0em; + margin-bottom: 0.3em; + } + +#content ul ul, +#content ul ol, +#content ol ul, +#content ol ol { + margin-left: 0.5em; + margin-top: 0.3em; + } + +#content ul li p, +#content ol li p { + margin-bottom: 0.3em; + line-height: 1.5em; + margin-left: 0 !important; + } + +/* Tables */ + +#content table { + margin: 0; + margin-top: 0.5em; + margin-bottom: 0.5em; + border-collapse: collapse; + clear: both; + border-width: 1px; + border-style: solid; + border-color: #EDEDED; + width: 100%; + } + +#content th { + background: #f8f8f8; + padding: 0.5em; + border-width: 1px; + border-style: solid; + border-color: #CCC; + } + +#content th.firstcol { + width: 1%; +} + +#content td { + border-width: 1px; + border-style: solid; + border-color: #CCC; + padding: 0.5em; + } + + +/* Presentation */ + +#header { + background-color: #204C8D; + background-image: url(img/header-background.png); + color: #fff; + } + +#header div.people_info { + float: right; + padding: 0.3em 10% 1.2em 1.2em; + padding-right: 10%; + text-align: center; + } + +#header .adminlinks { + float:right; + margin: 0.5em; + text-align: right; + font-size: 0.8em; + color: #eee; +} + +#logo { + color: #fff; + padding: 10px; + width: 500px; + } + +#logo img { + border: none; +} + +#logo .logo_text{ + font-size: 1.7em; + color: #fff; + margin-top: -50px; + float:left; + margin-left: 260px; + text-align:left; +} + +/* Ads */ + +.googlecontent { + clear: right; + margin: 0; +} + +/* Page lines */ + +.pageline_dark { + border: 1px solid #31629b; + clear: both; + margin:0; + padding:0; +} + +.pageline { + border-bottom:2px solid #cad9ee; + clear: both; + margin:0; + padding:0; +} + +.pageline_soft { + border: 1px solid #fff; + clear: both; + margin:0; + padding:0; +} + +/* Mainlinks */ + +.mainlinks { + display: block; + padding: 0; + padding-left: 20px; + margin: 0; + font-size: 0.8em; + background-color: #2b4f80; + height: 23px; + border-bottom: 2px solid #6fa4df; + } + +.mainlinks li { + float: left; + display: inline; + white-space: nowrap; + font-weight: bold; + padding:0; + padding-top:3px; + padding-bottom:3px; + } + +.mainlinks li a { + /* To cover the box area as linkable */ + padding: 10px; + padding-top: 4px; + padding-bottom: 4px; + border-right: 1px solid #25456f; + border-left: 1px solid #31629b; + } + +.mainlinks a, +.mainlinks a:visited { + color: #BDD3FB; + text-decoration: none; + } + +.mainlinks li.current a { + color: #25456f; + border-right: 1px solid #fff; + border-left: 1px solid #fff; + text-decoration: none; + } + +.mainlinks li:hover { + background-color: #436595; + padding-bottom: 3px; + } + +.mainlinks li:hover a { + color: #BDD3FB; + text-decoration: none; + } + +.mainlinks li:hover a:active { color:#BDD3FB; background-color:#436595; text-decoration:none;} +.mainlinks li a:active { color:#BDD3FB; background-color:#436595; text-decoration:none;} + +.mainlinks li.current, +.mainlinks li.current:hover, +.mainlinks li.current:hover a, +.mainlinks li.current:active a { + color: #25456f; + background: #f6f9ff; + padding-bottom: 5px; + } + +/* Sublinks */ + +.sublinks { + display: block; + margin:0; + padding: 0.8em; + white-space: nowrap; + background: #f6f9ff; + border-bottom:2px solid #cad9ee; + color: #000; + } +.sublinks ul { + margin: 0; + padding: 0; +} +.sublinks li { + display: inline; + border-right: 1px dotted #6fa4df; + padding-left:0.8em; + padding-right:0.8em; + } + +.sublinks li:last-child { + border-right: none; +} + +/* Entries pager */ + +#content .entrypager { + border-top: 1px solid #f8f8f8; + padding-top: 10px; + clear: both; +} + +#content .entrypager span { + display: inline; + font-size: 0.9em; +} + +/* Content */ + +#content .columnl { + display: block; + background-color: #fff; + margin: 0; + padding-right: 20px; + padding-left: 20px; + padding-bottom: 2em; + } + +#content .columnr div.center { text-align: center; } + +#content .columnr div.last { + border-top: 1px solid #fff; + border-bottom: none; +} + +#content .columnr p.first { + border-top: none; +} + +#content h1 { + color: #333; + line-height: 1em; + margin: 0px; + margin-bottom: 1em; + margin-top: 1em; + padding: 0px; +} + +#content h2, +#content h3, +#content h4, +#content h5, +#content h6 { + color: #333; + line-height: 0.7em; + margin: 0px; + margin-bottom: 1em; + padding: 0px; + } + +#content tt { + font-family: "DejaVu Sans Mono", "Liberation Sans Mono", monospace; +} + +#content { + clear:both; + padding-left:0px; + padding-right:0px; +} + +#content p { + color: #333; + line-height: 1.5em; + margin: 0; + padding: 0; + margin-bottom: 1em; + margin-top: 1em; +} + +#content pre { + font-size: 1.4em; + border-width: 1px; + border-style: solid; + border-color: #E5E5E5; + border-left-width: 4px; + white-space: pre; + background: #FFFAE9; + overflow: auto; + padding: 1em; +} + +#content hr { + margin-top: 1em; + margin-bottom: 1em; + padding: 0; + border: 1px solid #f8f8f8; + } + +.promoblock { + display: block; + float:left; + padding: 0; + padding-left: 1em; + padding-right: 0.5em; + margin-top: 0.5em; + margin-bottom: 0.5em; + border-left: 2px dotted #cad9ee; + height: 200px; + font-size: 0.8em; +} + +.promoblock p { + padding: 0em; + line-height: 1.5em; + margin: 0em; + margin-bottom: 1em; +} + +.promoblock.col1, +.promoblock.col2, +.promoblock.col3 { width: 20%;} +.promoblock.col4 { width: 30%; } + +.promoblock.first { border-left: none;} + +#content div.post p.info { + font-size: 0.8em; + margin-top: -1em !important; +} + +#content div.post.first p.info { + margin-top: -2em !important; +} + +#content .post { + margin-top: 1em; + padding-top: 1em; +} + +#content .post.first { + border-bottom: 1px solid #f8f8f8; +} + + +#content .post.first h2 { + font-size: 2em; +} + +/* Content - Forms */ + +#content form { + margin: 0; + padding: 0; + display: inline; +} + +div.formfields { + border-top: 1px solid #f8f8f8; + border-bottom: 1px solid #f8f8f8; +} + +div.formfields ul { + margin-left: 0px !important; + padding-left: 0px !important; +} + +div.formfields li { + + list-style: none; +} + +div.formfields li.description { + font-weight: bold; + text-align: right; + width: 180px; + padding-top: 5px; +} + +div.formfields li.value { + margin-left: 190px; + margin-top: -25px; +} + +div.formfields li.submit { + margin-top: 25px; + margin-left: 190px; +} + +#header input[type="submit"], +#header input[type="text"] { + border-width: 2px; + border-style: solid; + border-color: #204C8D; + background-color: #3B71B8; + color: #FFFFFF; + display: inline; + text-decoration: none; + padding: 1px; + padding-left: 4px; + padding-right: 4px; + } + +#header input[type="submit"] { + font-weight: bold; + cursor: pointer; + font-size: 0.8em; +} + +#header input[type="text"] { + font-size: 0.85em; + display: inline; + padding: 2px; + padding-left: 4px; + border: 2px solid #204C8D; + background-color: #EDF4FF; + color: #204C8D; + width: 130px; +} +#header select { + font-size: 0.8em; + border-width: 2px; + border-style: solid; + border-color: #204C8D; + background-color: #3B71B8; + color: #FFFFFF; + cursor: pointer; + display: inline; + font-weight: bold; + text-decoration: none; + padding: 1px; + } + +.input { + /* does strange effect to button (text size becomes bigger when clicking) + font-size: 1em; + font-family: Arial, Lucida Grande, sans-serif; + */ + } + +textarea { + font-size: 1em; + font-family: "DejaVu Sans Mono", "Liberation Mono", monospace; + } + +.disabled { + color: gray; + } + +/* Admonitions */ + +.lm { + background-color: #ECECEC; + background-image: url("img/moin-msg-bg-gray.png"); + width: -10px; + border-width: 1px; + border-style: solid; + border-color: #CFCFCF; + border-left-width: 4px; + padding: 1em !important; + } + +.lm.red { + border-color: #E0B7B7; + background-color: #FFECEC; + background-image: url("img/moin-msg-bg-red.png"); + } + +.lm.green { + border-color: #D6F6D2; + background-color: #EEFFEC; + background-image: url("img/moin-msg-bg-green.png"); + } + +.lm.violet { + border-color: #F6D2F6; + background-color: #FFECFF; + background-image: url("img/moin-msg-bg-violet.png"); + } + +.lm.blue { + border-color: #D2E0F6; + background-color: #ECF4FF; + background-image: url("img/moin-msg-bg-blue.png"); + } + +.lm.orange { + border-color: #F6E7D2; + background-color: #FFF8EC; + background-image: url("img/moin-msg-bg-orange.png"); + } + +.message { + margin-top: 2em; + margin-right: 20%; + margin-bottom: 2em; + margin-left: 20%; + padding-top: 1em; + padding-right: 1em; + padding-bottom: 1em; + padding-left: 1.5em; + border-width: 0; + border-top-width: 4px; + border-top-style: solid; + border-bottom-width: 4px; + border-bottom-style: solid; + text-align: center; + font-weight: bold; + } + +.message pre { + font-weight: normal !important; + text-align: left !important; + font-size: 1em !important; + +} +/* Footer */ + +#footer { + background-color: #204C8D; + background-image: url(img/header-background.png); + margin-top: 1em; + clear:both; + } + +#footer p { + font-size: small; + margin: 5px; + } + +#footer .mainlinks { + border-bottom: none; + height: 23px; + } + +#footer .mainlinks li { + padding-top: 4px; + padding-bottom: 2px; +} + +#footer .mainlinks li.current { + margin-top: -3px; + padding-bottom: 3px; + padding-top: 6px; +} + + +#footer .sublinks { + border-top:2px solid #cad9ee; + border-bottom-color: #6FA4DF; + } + +#footer .credits { + color: #eee; + font-size: small; + padding: 1em; + } + +#footer .credits p.right { + float: right; + padding-left: 15em; + text-align: right; +} diff --git a/Scripts/centos-web/config.php b/Scripts/centos-web/config.php new file mode 100755 index 0000000..583ec83 --- /dev/null +++ b/Scripts/centos-web/config.php @@ -0,0 +1,59 @@ + diff --git a/Scripts/centos-web/contents/content.php b/Scripts/centos-web/contents/content.php new file mode 100644 index 0000000..3032b7c --- /dev/null +++ b/Scripts/centos-web/contents/content.php @@ -0,0 +1,43 @@ +
    + + + +
    + +
    + +Donaciones

    Esta es la pagina de las donaciones

    '; +$page[2] = '

    Documentacion

    Esta es la pagina de la documentacion.

    '; +$page[3] = '

    Wiki

    Esta es la pagina de la wiki.

    '; +$page[4] = '

    Foros

    Esta es la pagina de los foros.

    '; + +// Initialize variables +if ( isset($_GET['p']) ) { + + // If $_GET['p'] is set the content shown is the pages one. + $id = htmlspecialchars($_GET['p']); + + echo $page[$id]; +} +else +{ + // If $_GET['p'] is not set the content shown is the entries's loop. + echo get_html_err(); +} + +// Validate id value + +?> + +
    +
    diff --git a/Scripts/centos-web/contents/footer.php b/Scripts/centos-web/contents/footer.php new file mode 100644 index 0000000..b902f6e --- /dev/null +++ b/Scripts/centos-web/contents/footer.php @@ -0,0 +1,20 @@ + + + + + + diff --git a/Scripts/centos-web/contents/header.php b/Scripts/centos-web/contents/header.php new file mode 100644 index 0000000..1a1aa72 --- /dev/null +++ b/Scripts/centos-web/contents/header.php @@ -0,0 +1,32 @@ + + + + + + <?php echo HTML_TITLE ?> + + + + + + diff --git a/Scripts/centos-web/contents/images/h1-background.png b/Scripts/centos-web/contents/images/h1-background.png new file mode 100755 index 0000000..966b7ed Binary files /dev/null and b/Scripts/centos-web/contents/images/h1-background.png differ diff --git a/Scripts/centos-web/contents/images/h2-background.png b/Scripts/centos-web/contents/images/h2-background.png new file mode 100755 index 0000000..7966dc0 Binary files /dev/null and b/Scripts/centos-web/contents/images/h2-background.png differ diff --git a/Scripts/centos-web/contents/images/header-background.png b/Scripts/centos-web/contents/images/header-background.png new file mode 100755 index 0000000..ff2a7b0 Binary files /dev/null and b/Scripts/centos-web/contents/images/header-background.png differ diff --git a/Scripts/centos-web/contents/images/html-background.png b/Scripts/centos-web/contents/images/html-background.png new file mode 100755 index 0000000..30f7d70 Binary files /dev/null and b/Scripts/centos-web/contents/images/html-background.png differ diff --git a/Scripts/centos-web/contents/images/layeredTech_logo08.gif b/Scripts/centos-web/contents/images/layeredTech_logo08.gif new file mode 100755 index 0000000..c31ec0b Binary files /dev/null and b/Scripts/centos-web/contents/images/layeredTech_logo08.gif differ diff --git a/Scripts/centos-web/contents/images/logo.png b/Scripts/centos-web/contents/images/logo.png new file mode 100644 index 0000000..4828ae2 Binary files /dev/null and b/Scripts/centos-web/contents/images/logo.png differ diff --git a/Scripts/centos-web/contents/images/release-promo.png b/Scripts/centos-web/contents/images/release-promo.png new file mode 100644 index 0000000..a4221c7 Binary files /dev/null and b/Scripts/centos-web/contents/images/release-promo.png differ diff --git a/Scripts/centos-web/contents/images/rss.png b/Scripts/centos-web/contents/images/rss.png new file mode 100644 index 0000000..79767ef Binary files /dev/null and b/Scripts/centos-web/contents/images/rss.png differ diff --git a/Scripts/centos-web/contents/images/ul.png b/Scripts/centos-web/contents/images/ul.png new file mode 100755 index 0000000..fd89ccd Binary files /dev/null and b/Scripts/centos-web/contents/images/ul.png differ diff --git a/Scripts/centos-web/contents/images/ul2.png b/Scripts/centos-web/contents/images/ul2.png new file mode 100644 index 0000000..467b107 Binary files /dev/null and b/Scripts/centos-web/contents/images/ul2.png differ diff --git a/Scripts/centos-web/contents/images/xpressbannew_240.gif b/Scripts/centos-web/contents/images/xpressbannew_240.gif new file mode 100644 index 0000000..dfdf197 Binary files /dev/null and b/Scripts/centos-web/contents/images/xpressbannew_240.gif differ diff --git a/Scripts/centos-web/contents/sidebar.php b/Scripts/centos-web/contents/sidebar.php new file mode 100644 index 0000000..11e3b77 --- /dev/null +++ b/Scripts/centos-web/contents/sidebar.php @@ -0,0 +1,35 @@ +
    + +
    promo
    + +
    + +

    + +
    + +
    +

    + +
    + +
    +

    + +
    + +
    + +
    + +
    + +
    diff --git a/Scripts/centos-web/contents/single.php b/Scripts/centos-web/contents/single.php new file mode 100644 index 0000000..bebb7e4 --- /dev/null +++ b/Scripts/centos-web/contents/single.php @@ -0,0 +1,43 @@ +
    + +The page $id isn't readable!

    "; + } + + } + else { + echo "

    The page $id doesn't exist!

    "; + } + +} +else { + + $id = 0; + include("pages/p_index.php"); + +} + +// Validate id value + +?> + +
    diff --git a/Scripts/centos-web/contents/style.css b/Scripts/centos-web/contents/style.css new file mode 100644 index 0000000..58888cd --- /dev/null +++ b/Scripts/centos-web/contents/style.css @@ -0,0 +1,554 @@ +/*** + * Style used in some server responses. + * + * -- CentOS Artwork SIG. + * http://projects.centos.org/trac/artwork/wiki/WebServerCustomization + */ + +html { + background-color: #FFF; + background-image: url(images/html-background.png); + font-family: "DejaVu Sans", "Liberation Sans", sans-serif; + font-size: 0.85em; + line-height: 1.25em; + margin: 0 4% 0 4%; /* <- with 4% of left and right margin */ + } + +body { + background: #FFF; + border-width: 10px; + border-style: solid; + border-color: #FFF; + padding:0; + margin: 0; + } + +/* RSS */ + +#header .rss { + float:right; + padding: 0; + margin: 0; + margin-right: 1em; + border: none; +} + +/* Links */ + +a:link { text-decoration: none; color: #204C8D } +a:hover { text-decoration: underline; color: green; } +a:active { text-decoration: underline; color: green; } +a:visited { text-decoration: none; color: #204C8D; } +a:visited:hover { text-decoration: underline; color: green; } + +#footer .credits a:link { border-bottom: 1px dotted #eee; text-decoration: none; color: #eee } +#footer .credits a:hover { border-bottom: 1px dotted #eee; text-decoration: underline; color: #fff; } +#footer .credits a:active { border-bottom: 1px dotted #eee; text-decoration: underline; color: #eee; } +#footer .credits a:visited { border-bottom: 1px dotted #eee; text-decoration: none; color: #eee; } +#footer .credits a:visited:hover { border-bottom: 1px dotted #eee; text-decoration: underline; color: #fff; } + +/* Alignment */ + +.floatr { float: right; } +.floatl { float: left; } + +/* Lists */ + +#content ul, +#content ol { + padding-left: 1.9em; + margin-left: 3em; + margin-bottom: 1em; + } + +#content ul { + list-style: url("images/ul.png") circle; + } + +#content ol { + list-style-image: none !important; + } + +#content ul li { + padding-left: 0em; + margin-bottom: 0.3em; + } + +#content ol li { + padding-left: 0em; + margin-bottom: 0.3em; + } + +#content ul ul, +#content ul ol, +#content ol ul, +#content ol ol { + margin-left: 0.5em; + margin-top: 0.3em; + } + +#content ul li p, +#content ol li p { + margin-bottom: 0.3em; + line-height: 1.5em; + margin-left: 0 !important; + } + +/* Tables */ + +#content table { + width: 100%; + font-size: inherit; + } + +#content th { + padding-left: 5px; + padding-right: 5px; + } + +#content th { + background-image: url(images/h2-background.png); + } + +/* Presentation */ + +#header { + background-color: #204C8D; + background-image: url(images/header-background.png); + color: #fff; + } + +#header div.people_info { + float: right; + padding: 0.3em 10% 1.2em 1.2em; + padding-right: 10%; + text-align: center; + } + +#header .adminlinks { + float:right; + margin: 0.5em; + text-align: right; + font-size: 0.9em; + color: #eee; +} + +#header .adminlinks a { + margin-left: 0.5em; + margin-right: 0.5em; +} + +#logo { + color: #fff; + padding: 10px; + width: 500px; + } + +#logo img { + border: none; +} + +#logo .logo_text{ + font-size: 1.7em; + color: #fff; + margin-top: -50px; + float:left; + margin-left: 260px; + text-align:left; +} + +/* Ads */ + +.googlecontent { + clear: right; + margin: 0; +} + +/* Page lines */ + +.pageline_dark { + border: 1px solid #31629b; + clear: both; + margin:0; + padding:0; +} + +.pageline { + border-bottom:2px solid #cad9ee; + clear: both; + margin:0; + padding:0; +} + +.pageline_soft { + border: 1px solid #fff; + clear: both; + margin:0; + padding:0; +} + +/* Mainlinks */ + +.mainlinks { + display: block; + padding: 0; + padding-left: 20px; + margin: 0; + font-size: 0.8em; + background-color: #2b4f80; + height: 23px; + border-bottom: 2px solid #6fa4df; + } + +.mainlinks li { + float: left; + display: inline; + white-space: nowrap; + font-weight: bold; + padding:0; + padding-top:3px; + padding-bottom:3px; + } + +.mainlinks li a { + /* To cover the box area as linkable */ + padding: 10px; + padding-top: 4px; + padding-bottom: 4px; + border-right: 1px solid #25456f; + border-left: 1px solid #31629b; + } + +.mainlinks a, +.mainlinks a:visited { + color: #BDD3FB; + text-decoration: none; + } + +.mainlinks li.current a { + color: #25456f; + border-right: 1px solid #fff; + border-left: 1px solid #fff; + text-decoration: none; + } + +.mainlinks li:hover { + background-color: #436595; + padding-bottom: 3px; + } + +.mainlinks li:hover a { + color: #BDD3FB; + text-decoration: none; + } + +.mainlinks li:hover a:active { color:#BDD3FB; background-color:#436595; text-decoration:none;} +.mainlinks li a:active { color:#BDD3FB; background-color:#436595; text-decoration:none;} + +.mainlinks li.current, +.mainlinks li.current:hover, +.mainlinks li.current:hover a, +.mainlinks li.current:active a { + color: #25456f; + background-color: #fff; + padding-bottom: 5px; + } + +/* Entries pager */ + +#content .entrypager { + border-top: 1px solid #f8f8f8; + clear: both; +} + +#content .entrypager span { + display: inline; + font-size: 0.9em; + padding: 1em; +} + +/* Content */ + +#content .columnl { + display: block; + background-color: #fff; + margin: 0; + margin-right: 300px; + padding: 20px; + } + +#content .columnr { + display: block; + width: 300px; + float:right; + background: #f6f9ff; + border: 1px solid #a0bbe1; + margin-bottom: 1em; + } + +#content .columnr div { + margin: 0; + padding: 1em; + font-size: 0.9em; + } + +#content .columnr a { + font-weight: bold; +} + +#content .columnr div.row, +#content .columnr div.row_search, +#content .columnr div.row_download, +#content .columnr div.row_promo, +#content .columnr div.row_release, +#content .columnr div.row_user, +#content .columnr div.row_sponsor, +#content .columnr div.row_subscribe { + border-top: 1px solid #fff; + border-bottom: 1px solid #cad9ee; +} + +#content .columnr div ul { + margin: 0; + list-style: url("images/ul2.png") circle; +} + +#content .columnr div.row_promo img { + padding: 5px; + background: #fff; + border: 1px solid #a0bbe1; +} + +#content .columnr div.center { text-align: center; } + +#content .columnr div.last { + border-top: 1px solid #fff; + border-bottom: none; +} + +#content .columnr p.first { + border-top: none; +} + +#content h1 { + color: #333; + line-height: 1em; + margin: 0px; + margin-bottom: 1em; + padding: 0px; +} + +#content h2, +#content h3, +#content h4, +#content h5, +#content h6 { + color: #333; + line-height: 0.7em; + margin: 0px; + margin-bottom: 1em; + padding: 0px; + } + +#content tt { + font-family: "DejaVu Sans Mono", "Liberation Sans Mono", monospace; +} + +#content { + clear:both; + padding: 1em; + background: #fff; +} + +#content p { + color: #333; + line-height: 1.5em; + margin: 0; + padding: 0; + margin-bottom: 1em; + margin-top: 1em; +} + +#content pre { + font-size: 1.4em; + border-width: 1px; + border-style: solid; + border-color: #E5E5E5; + border-left-width: 4px; + white-space: pre; + background: #FFFAE9; + overflow: auto; + padding: 1em; +} + +#content hr { + margin-top: 1em; + margin-bottom: 1em; + padding: 0; + border: 1px solid #f8f8f8; + } + +.promoblock { + display: block; + float:left; + padding: 0; + padding-left: 1em; + padding-right: 0.5em; + margin-top: 0.5em; + margin-bottom: 0.5em; + border-left: 2px dotted #cad9ee; + height: 150px; + font-size: 0.8em; + width: 20%; +} + +.promoblock p { + padding: 0em; + line-height: 1.5em; + margin: 0em; + margin-bottom: 1em; +} + +.promoblock.last { width: 30%; } + +.promoblock.first { border-left: none;} + +#content div.post p.info { + font-size: 0.8em; + margin-top: -1em !important; +} + +#content div.post.first p.info { + margin-top: -2em !important; +} + +#content .post { + margin-top: 1em; + padding-top: 1em; +} + +#content .post.first { + border-bottom: 1px solid #f8f8f8; +} + + +#content .post.first h2 { + font-size: 2em; +} + +/* Content - Forms */ + +form { + margin: 0; + padding: 0; + display: inline; +} + +#header input[type="submit"], +#header input[type="text"] { + border-width: 2px; + border-style: solid; + border-color: #204C8D; + background-color: #3B71B8; + color: #FFFFFF; + display: inline; + text-decoration: none; + padding: 1px; + padding-left: 4px; + padding-right: 4px; + } + +#header input[type="submit"] { + font-weight: bold; + cursor: pointer; + font-size: 0.8em; +} + +#header input[type="text"] { + font-size: 0.85em; + margin-right: 2px; + display: inline; + padding: 2px; + padding-left: 4px; + border: 2px solid #204C8D; + background-color: #EDF4FF; + color: #204C8D; + width: 130px; +} +#header select { + font-size: 0.8em; + border-width: 2px; + border-style: solid; + border-color: #204C8D; + background-color: #3B71B8; + color: #FFFFFF; + cursor: pointer; + display: inline; + font-weight: bold; + text-decoration: none; + padding: 1px; + } + +.input { + /* does strange effect to button (text size becomes bigger when clicking) + font-size: 1em; + font-family: Arial, Lucida Grande, sans-serif; + */ + } + +textarea { + font-size: 1.4em; + font-family: "DejaVu Sans Mono", "Liberation Mono", monospace; + } + +.disabled { + color: gray; + } + +/* Footer */ + +#footer { + background-color: #204C8D; + background-image: url(images/header-background.png); + margin-top: 1em; + clear:both; + } + +#footer p { + font-size: small; + margin: 5px; + } + +#footer .mainlinks { + border-top: 2px solid #6fa4df; + border-bottom: none; + height: 23px; + } + +#footer .mainlinks li { + padding-bottom: 3px; +} + +#footer .mainlinks li.current { + margin-top: -3px; + padding-bottom: 3px; + padding-top: 6px; +} + + +#footer .sublinks { + border-top:2px solid #cad9ee; + border-bottom: none; + } + +#footer .credits { + color: #eee; + font-size: small; + padding: 1em; + } + +#footer .credits p.right { + float: right; + padding-left: 15em; + text-align: right; +} diff --git a/Scripts/centos-web/includes/functions/html.php b/Scripts/centos-web/includes/functions/html.php new file mode 100644 index 0000000..fe7cc4a --- /dev/null +++ b/Scripts/centos-web/includes/functions/html.php @@ -0,0 +1,132 @@ +' . "\n"; + + if (!isset($_GET['p'])) + { + + $html .= '
  • ' . strtoupper(translate('home')) . '
  • ' . "\n"; + + } + else + { + $html .= '
  • ' . strtoupper(translate('home')) . '
  • ' . "\n"; + } + + foreach ($mainlinks as $key => $value) + { + if (isset($_GET['p']) && $_GET['p'] == $key) + { + $html .= '
  • ' . strtoupper($value). "
  • " . "\n"; + } + else + { + $html .= '
  • ' . strtoupper($value). "
  • " . "\n"; + } + } + +$html .= '' . "\n"; +return $html; + +} + + // Display promotions +function get_html_promo() +{ + $promotion = array(); + $promotion['CentOS-5 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...'; + $promotion['CentOS-4 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...'; + $promotion['CentOS-3 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...'; + $promotion['CentOS-2 Releases'] = 'Information about CentOS-5 releases will be displayed here. Read more ...'; + + $counter = 0; + $last_promotion = count($promotion) -1; + + echo '
    ' . "\n"; + + foreach ( $promotion as $key => $value ) + { + + // Set first promoblock + switch ($counter) + { + case 0: + $html = '
    '; + break; + + case $last_promotion: + $html .= '
    '; + break; + + default: + $html .= '
    '; + } + + $html .= '

    ' . $key . '

    ' . "\n"; + $html .= '

    ' . $value . '

    ' . "\n"; + $html .= '
    '; + + $counter++; + } + +return $html; + +} + +function get_html_searchform() +{ + $html = '
    '; + $html .= '
    '; + $html .= ''; + $html .= ''; + $html .= '
    '; + $html .= '
    '; + + return $html; +} + +// Build 404 page not found error +function get_html_err($err_id = '404', $err_msg = 'Page not found', $err_descrip = '') +{ + $html = '

    ' . $err_id . ': ' . ucfirst($err_msg) . '

    ' . "\n"; + $html .= '

    ' . $err_descrip. '

    '; + return $html; +} + +?> diff --git a/Scripts/centos-web/includes/translations/en.php b/Scripts/centos-web/includes/translations/en.php new file mode 100644 index 0000000..7616ba6 --- /dev/null +++ b/Scripts/centos-web/includes/translations/en.php @@ -0,0 +1,42 @@ + + */ + + function translate($word) + { + + $translation = array('' => '', + // Admonition translations + // LDAP translations + 'uid' => 'User ID', + 'cn' => 'Full Name', + 'preferredlanguage' => 'Language', + 'employeetype'=>'privileges', + 'displayname'=>'nickname', + 'userpassword'=>'password', + // Others + 'go back' => 'go back', + 'default_f' => 'default', + 'default_m' => 'default', + 'en' => 'English', + 'credits_on_footer_1' => 'The CentOS Project - '.date('Y').' | "Linux" is a registered trademark of Linus Torvalds. All other trademarks are property of their respective owners.', + ''=>''); + + // if $word hasn't a translation here, return it. + if ( array_key_exists($word, $translation)) + { + $translation[$word] = $translation[$word]; + return $translation[$word]; + } + else + { + return $word; + } + } + +?> diff --git a/Scripts/centos-web/includes/translations/es.php b/Scripts/centos-web/includes/translations/es.php new file mode 100644 index 0000000..0057d1c --- /dev/null +++ b/Scripts/centos-web/includes/translations/es.php @@ -0,0 +1,162 @@ + + */ + + function translate($word) + { + $translation = array(); + $translation = array('change' => 'cambiar', + // Errores Messages + '001' => 'nombre de usuario o contraseña incorrecta!', + '002' => 'Se encontraron valores duplicados en el directorio LDAP para el campo uid', + 'a valid uid is required' => 'se requiere un identificador único de usuario', + 'the field' => 'el campo', + 'invalid action' => 'acción no soportada', + 'user added successfully' => 'el usuario fue adicionado satisfactoriamente', + 'is required' => 'es obligatorio', + 'requires a valid value' => 'tiene un valor incorrecto', + 'incorrect value in the field' => 'valor incorrecto en el campo', + 'user identifier already exists' => 'el identificador único de usuario ya existe', + 'successful update' => 'actualización satisfactoria', + 'update failed' => 'actualización fallida', + 'nothing to do' => 'nada que hacer', + 'data was removed successfully' => 'los datos fueron eliminados satisfactoriamente', + 'data was deleted successfully' => 'los datos fueron eliminados satisfactoriamente', + 'data was updated successfully' => 'los datos fueron actualizados satisfactoriamente', + 'data was not removed' => 'los datos no fueron eliminados', + "the category dosn't exist" => "la categoría no existe", + 'data was not updated' => 'los datos no fueron actualizados', + 'field name can not be empty' => 'El campo nombre no puede estar vacío', + 'id value is incorrect' => 'El valor del campo Id es incorrecto', + 'record deleted successfully' => 'registro eliminado satisfactoriamente', + 'records deleted successfully' => 'registros eliminados satisfactoriamente', + 'category was added successfully' => 'la categoría fue adicionada satisfactoriamente', + 'category was not added' => 'la categoría no fue adicionada', + 'invalid cn' => 'valor incorrecto en el campo nombre común' , + 'page not found' => 'página no encontrada' , + // LDAP attributes + 'cn' => 'nombre común', + 'mail' => 'correo', + 'uid' => 'identificador único', + 'preferredlanguage' => 'Idioma preferido', + 'displayname' => 'Apodo', + 'userpassword' => 'Contraseña', + 'employeetype' => 'tipo de empleo', + // Database error messages + 'connected' => 'conectado', + 'Field name can not be empty' => 'El campo Nombre no puede estar vacío', + 'name' => 'nombre', + 'description' => 'descripción', + 'disconnected' => 'desconectado', + // Non error messages below + 'home' => 'inicio', + 'edit' => 'Editar', + 'delete' => 'eliminar', + 'es' => 'Español', + 'download' => 'descargas', + 'links' => 'enlaces', + 'comments' => 'comentarios', + 'comment' => 'comentario', + 'link' => 'enlace', + 'parent category' => 'categoría padre', + 'group' => 'grupo', + 'default_f' => 'predeterminada', + 'default_m' => 'predeterminado', + 'none' => 'ninguno', + 'administrator' => 'administrador', + 'writer' => 'escritor', + 'find' => 'Buscar', + 'archive' => 'archivo', + 'hello' => 'hola', + 'actions' => 'acciones', + 'action' => 'acción', + 'accept' => 'aceptar', + 'remove' => 'eliminar', + 'user' => 'usuario', + 'logout' => 'salir', + 'filter' => 'filtrar', + 'contactus' => 'contáctenos', + 'news' => 'noticias', + 'administration' => 'administración', + 'admin' => 'administrar', + 'support' => 'soporte', + 'write' => 'escribir', + 'ex' => 'ej', + 'information' => 'información', + 'events' => 'eventos', + 'mailinglists' => 'listas de correo', + 'bugs' => 'bugs', + 'help' => 'ayuda', + 'documentation' => 'documentación', + 'faqs' => 'faqs', + 'forums' => 'foros', + 'wiki' => 'wiki', + 'donate' => 'donaciones', + 'language' => 'idioma', + 'languages' => 'idiomas', + 'permissions' => 'permisos', + 'go' => 'ir', + 'login' => 'entrar', + 'bugs' => 'errores', + 'hi' => 'hola', + 'powered by' => 'soportado por', + 'register' => 'registrar cuenta nueva', + 'newaccount' => 'cuenta nueva', + 'lostpwd' => 'perdió su contraseña ?', + 'previous entries' => 'Entradas anteriores', + 'next entries' => 'Entradas siguientes', + 'update' => 'Actualizar', + 'first' => 'primero', + 'last' => 'ultimo', + 'password' => 'contraseña', + 'categories' => 'categorías', + 'category' => 'categoría', + 'category tree' => 'Árbol de categorías', + 'hierarchy' => 'jerarquía', + 'close' => 'cerrar', + 'session' => 'sesión', + 'view' => 'ver', + 'go back to' => 'regresar al', + 'go back' => 'regresar', + 'site' => 'sitio', + 'add' => 'adicionar', + 'years' => 'años', + 'permissions' => 'permisos', + 'note' => 'nota', + 'news' => 'noticias', + 'user' => 'usuario', + 'welcome' => 'bienvenido', + 'search results' => 'Resultados de la búsqueda', + 'results' => 'resultados', + 'looking in' => 'buscando en', + 'filtering by' => 'filtrando por', + 'admin_info_1' => 'esta aplicación te permitirá administrar el portal.', + 'entry' => 'entrada', + 'page' => 'página', + 'users' => 'usuarios', + 'entries' => 'entradas', + 'portal administration' => 'Administración del portal', + 'pages' => 'páginas', + 'sponsors' => 'patrocinadores', + 'search' => 'buscar', + 'credits_on_footer_1' => 'The CentOS Project - '.date('Y').' | "Linux" es una marca registrada de Linus Torvalds. Todas las otras marcas comerciales son propiedad de sus respectivos dueños.', + 'username' => 'usuario' ); + + // if $word hasn't a translation here, return it. + if ( array_key_exists($word, $translation)) + { + $translation[$word] = $translation[$word]; + return $translation[$word]; + } + else + { + return $word; + } + +} +?> diff --git a/Scripts/centos-web/index.php b/Scripts/centos-web/index.php new file mode 100755 index 0000000..b585d0b --- /dev/null +++ b/Scripts/centos-web/index.php @@ -0,0 +1,25 @@ +