Permalink
Browse files

Global PHP code refactoring/cleaning

  • Loading branch information...
1 parent fdc49c8 commit 88be1efe0fc6ee9acf153318b1712da82bb5caf0 @ptejada committed Jan 25, 2012
Showing with 28 additions and 48 deletions.
  1. +5 −7 core/config.php
  2. +0 −13 core/db_connect.php
  3. +21 −0 core/user_config.php
  4. +0 −24 get.php
  5. +1 −3 index.php
  6. 0 js/dev/core.js
  7. +1 −1 user.php
View
@@ -14,17 +14,15 @@ function get_execution_time(){
get_execution_time();
/*=================================*/
- include("inc/functions.php");
-
- //New User activation option
- $enable_activation = false; //If true users will required to activate their account by email
-
- include_once('db_connect.php');
+ include_once('inc/functions.php');
include_once('client_files.php');
include_once('inc/class.uFlex.php');
include_once('inc/class.iD.php');
+ include_once('user_config.php');
- //require('functions.php');
+ //Stablish database conection
+ $db_link = mysql_connect($iD_option['db_host'], $iD_option['db_user'], $iD_option['db_pass']);
+ $iD_connection = mysql_select_db($iD_option['db_name'], $db_link);
/*-----------------NO EDIT LINE LIMIT---------------*/
View
@@ -1,13 +0,0 @@
-<?php
- //Databse Connection link
- $db_host = $_SERVER['HTTP_HOST'] == "localhost" ? "localhost" : "75.125.121.246"; //Database host
- $db_user = $_SERVER['HTTP_HOST'] == "localhost" ? "ptejada" : "ptejada_uflex"; //Database user
- $db_pass = "mspress#1"; //Database user's password
- $db_name = $_SERVER['HTTP_HOST'] == "localhost" ? "uflex" : "ptejada_uflex"; //Database name
-
-
- //----NO EDIT---//
-
- $db_link = mysql_connect($db_host, $db_user, $db_pass);
- $connection = mysql_select_db($db_name, $db_link);
-?>
View
@@ -0,0 +1,21 @@
+<?php
+ /*
+ * User defined Options
+ */
+
+ $iD_option = array(
+ //Database information
+ "db_host" => "localhost", //Database host
+ "db_user" => "ptejada", //Database user
+ "db_pass" => "mspress#1", //Database user's password
+ "db_name" => "demo_id", //Database name
+
+ //New User activation option
+ "enable_activation" => false //If true users will required to activate their account by email
+ );
+
+
+//////////////////////////////////////
+//NO EDITS REQUIRED BELOW THIS LINE///
+//////////////////////////////////////
+?>
View
24 get.php
@@ -33,28 +33,4 @@
$iD->form($form);
}
-?>
-<?php
-/*
- if($get === "icons"){
- $ids = $_GET['icons'];
-
- foreach($ids as $id=>$size){
- $ids[$size][] = intval($id);
- }
-
- $response = array();
-
- foreach($ids as $size=>$idsSet){
-
- $res = $iD->icons($idsSet,$size,false);
-
- $response = array_merge($response,$res);
-
- }
-
- //aPrint($response);
- echo json_encode($response);
- }else if($get === "form"){
-*/
?>
View
@@ -1,6 +1,4 @@
-<?php
-require('include.php');
-?>
+<?php require('include.php'); ?>
<!DOCTYPE html>
<html>
View
No changes.
View
@@ -39,7 +39,7 @@
//Normalize email
@$_POST['email'] = strtolower(trim($_POST['email']));
- $confirm = $user->register($_POST,$enable_activation); //$enable_activation from the config.php file
+ $confirm = $user->register($_POST, $iD_option["enable_activation"]); //$enable_activation from the config.php file
if($confirm and $enable_activation){ //$enable_activation from the config.php file
include('class.mail.php');

0 comments on commit 88be1ef

Please sign in to comment.