public function createAccountSubmit()
 {
     $rules = array("username" => "required|min:6", "password" => "required|min:6", "confirm_password" => "required|same:password", "email" => "required|email");
     $validator = Validator::make(Input::all(), $rules);
     if ($validator->fails()) {
         $messages = $validator->messages();
         return Redirect::to("create")->withInput(Input::except('password', 'password_confirm'))->withErrors($validator);
     }
     $first_name = $_POST['first_name'];
     $last_name = $_POST['last_name'];
     $username = $_POST['username'];
     $password = $_POST['password'];
     $email = $_POST['email'];
     //Fixme - Save these user information
     //        $organization = $_POST['organization'];
     //        $address = $_POST['address'];
     //        $country = $_POST['country'];
     //        $telephone = $_POST['telephone'];
     //        $mobile = $_POST['mobile'];
     //        $im = $_POST['im'];
     //        $url = $_POST['url'];
     $organization = "";
     $address = "";
     $country = "";
     $telephone = "";
     $mobile = "";
     $im = "";
     $url = "";
     if (WSIS::usernameExists($username)) {
         return Redirect::to("create")->withInput(Input::except('password', 'password_confirm'))->with("username_exists", true);
     } else {
         WSIS::addUser($username, $password, $first_name, $last_name, $email, $organization, $address, $country, $telephone, $mobile, $im, $url);
         //update user profile
         WSIS::updateUserProfile($username, $email, $first_name, $last_name);
         //creating a default project for user
         ProjectUtilities::create_default_project($username);
         CommonUtilities::print_success_message('New user created!');
         return View::make('account/login');
     }
 }
 private function initializeWithAiravata($username)
 {
     //Check Airavata Server is up
     try {
         //creating a default project for user
         $projects = ProjectUtilities::get_all_user_projects(Config::get('pga_config.airavata')['gateway-id'], $username);
         if ($projects == null || count($projects) == 0) {
             //creating a default project for user
             ProjectUtilities::create_default_project($username);
         }
     } catch (Exception $ex) {
         CommonUtilities::print_error_message("Unable to Connect to the Airavata Server Instance!");
         return View::make('home');
     }
     return Redirect::to("admin/dashboard");
 }