Example #1
0
 public function postAdminAccount()
 {
     $data = Input::all();
     //return View::make('install.done');
     try {
         $user = Sentry::createUser(array('email' => $data['email'], 'password' => $data['password'], 'activated' => true, 'first_name' => $data['first_name'], 'last_name' => $data['last_name']));
         $group = Sentry::findGroupByName('admin');
         $user->addGroup($group);
         $quicknote = new \Quicknote();
         $quicknote->user_id = $user->id;
         $quicknote->save();
         $userProfile = new \UserProfile();
         $userProfile->id = $user->id;
         $userProfile->save();
         $imageResult = App::make('AuthController')->{'createUserImage'}($user->id, $data['first_name'][0], $data['last_name'][0]);
         $installationDate = date('Y-m-d H:i:s');
         $installationHost = Request::server('PATH_INFO');
         $new92fiveConfig = new NewConfig();
         $new92fiveConfig->toFile(app_path() . '/config/92five.php', ['install' => true, 'version' => '1.0', 'installationDate' => $installationDate, 'installationHost' => $installationHost]);
         return View::make('install.done');
     } catch (Exception $e) {
         Log::error('Something Went Wrong in Install Controller Repository - addUserWithDetails():' . $e->getMessage());
         throw new Exception('Something Went Wrong in Install Controller Repository - addUserWithDetails()');
     }
 }
 public function testToFile()
 {
     $writer = new Rewrite();
     $filePath = __DIR__ . '../../fixtures/Config/sample-config.php';
     $tmpFile = __DIR__ . '../../fixtures/Config/temp-config.php';
     copy($filePath, $tmpFile);
     $contents = $writer->toFile($tmpFile, ['connections.sqlite.driver' => 'sqlbite']);
     $result = (include $tmpFile);
     $this->assertArrayHasKey('connections', $result);
     $this->assertArrayHasKey('sqlite', $result['connections']);
     $this->assertArrayHasKey('driver', $result['connections']['sqlite']);
     $this->assertEquals('sqlbite', $result['connections']['sqlite']['driver']);
     unlink($tmpFile);
 }
Example #3
0
 /**
  * Update Mail Settings
  * @return Redirect
  */
 public function postEmailSettings()
 {
     try {
         $data = \Input::all();
         $newMailConfig = new NewConfig();
         if ($data['encryption'] == 'null') {
             $data['encryption'] = null;
         }
         $newMailConfig->toFile(app_path() . '/config/mail.php', ['host' => $data['host'], 'port' => $data['port'], 'from.address' => $data['senderaddress'], 'from.name' => $data['sendername'], 'username' => $data['username'], 'password' => $data['password'], 'encryption' => $data['encryption']]);
         return \Redirect::to('dashboard/admin')->with('status', 'success')->with('message', 'Settings Updated');
     } catch (\Exception $e) {
         \Log::error('Something Went Wrong in Admin Controller - postEmailSettings():' . $e->getMessage());
         return \Redirect::to('dashboard/admin')->with('status', 'error')->with('message', 'Something Went Wrong');
     }
 }