Updates
Fixed CLI installer Fixed First user detail seeder
This commit is contained in:
@@ -44,8 +44,8 @@ class Install extends Command
|
||||
$this->appEnv();
|
||||
if ($this->confirm('Do you want to intall faveo?')) {
|
||||
$default = $this->choice(
|
||||
'Which sql engine would you like to use?', ['mysql']
|
||||
);
|
||||
'Which sql engine would you like to use?', ['mysql']
|
||||
);
|
||||
$host = $this->ask('Enter your sql host');
|
||||
$database = $this->ask('Enter your database name');
|
||||
$dbusername = $this->ask('Enter your database username');
|
||||
@@ -66,20 +66,10 @@ class Install extends Command
|
||||
public function appEnv()
|
||||
{
|
||||
$extensions = [
|
||||
'curl',
|
||||
'ctype',
|
||||
'imap',
|
||||
'mbstring',
|
||||
'mcrypt',
|
||||
'mysql',
|
||||
'openssl',
|
||||
'tokenizer',
|
||||
'zip',
|
||||
'pdo',
|
||||
'mysqli',
|
||||
'bcmath',
|
||||
'iconv',
|
||||
//'ioncube_loader_dar_5.6',
|
||||
'curl', 'ctype', 'imap', 'mbstring',
|
||||
'openssl', 'tokenizer', 'zip',
|
||||
'pdo', 'mysqli', 'bcmath', 'iconv',
|
||||
'XML', 'json', 'fileinfo',
|
||||
];
|
||||
$result = [];
|
||||
foreach ($extensions as $key => $extension) {
|
||||
@@ -91,10 +81,10 @@ class Install extends Command
|
||||
}
|
||||
}
|
||||
$result['php']['extension'] = 'PHP';
|
||||
if (phpversion() === 7.0) {
|
||||
if (phpversion() >= 7.1) {
|
||||
$result['php']['status'] = 'PHP version supports';
|
||||
} else {
|
||||
$result['php']['status'] = "PHP version doesn't supports please upgrade to 7.0";
|
||||
$result['php']['status'] = "PHP version doesn't supports please upgrade to 7.1+";
|
||||
}
|
||||
|
||||
$headers = ['Extension', 'Status'];
|
||||
|
89
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file
89
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\User;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
use Illuminate\Http\Request;
|
||||
use Lang;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(PhpMailController $PhpMailController)
|
||||
{
|
||||
$this->middleware('guest');
|
||||
$this->PhpMailController = $PhpMailController;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a reset link to the given user.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function sendResetLinkEmail(Request $request)
|
||||
{
|
||||
try {
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$this->validate($request, ['email' => 'required']);
|
||||
\Event::fire('reset.password', []);
|
||||
$user = User::where('email', '=', $request->all('email'))->orWhere('mobile', '=', $request->all('email'))->first();
|
||||
if (isset($user)) {
|
||||
$user1 = $user->email;
|
||||
//gen new code and pass
|
||||
$code = str_random(60);
|
||||
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->first();
|
||||
if (isset($password_reset_table)) {
|
||||
$password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->update(['token' => $code, 'created_at' => $date]);
|
||||
// $password_reset_table->token = $code;
|
||||
// $password_reset_table->update(['token' => $code]);
|
||||
} else {
|
||||
$create_password_reset = \DB::table('password_resets')->insert(['email' => $user->email, 'token' => $code, 'created_at' => $date]);
|
||||
}
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->user_name, 'email' => $user->email], $message = ['subject' => 'Your Password Reset Link', 'scenario' => 'reset-password'], $template_variables = ['user' => $user->first_name, 'email_address' => $user->email, 'password_reset_link' => url('password/reset/'.$code)], true);
|
||||
if ($user->mobile != '' && $user->mobile != null) {
|
||||
if ($user->first_name) {
|
||||
$name = $user->first_name;
|
||||
} else {
|
||||
$name = $user->user_name;
|
||||
}
|
||||
$value = [
|
||||
'url' => url('password/reset/'.$code),
|
||||
'name' => $name,
|
||||
'mobile' => $user->mobile,
|
||||
'code' => $user->country_code, ];
|
||||
\Event::fire('reset.password2', [$value]);
|
||||
}
|
||||
|
||||
return redirect()->back()->with('status', Lang::get('lang.we_have_e-mailed_your_password_reset_link'));
|
||||
} else {
|
||||
return redirect()->back()->with('fails', Lang::get("lang.we_can't_find_a_user_with_that_e-mail_address"));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
dd($e);
|
||||
|
||||
return redirect()->back()->with('fails', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
38
app/Http/Controllers/Auth/LoginController.php
Normal file
38
app/Http/Controllers/Auth/LoginController.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles authenticating users for the application and
|
||||
| redirecting them to your home screen. The controller uses a trait
|
||||
| to conveniently provide its functionality to your applications.
|
||||
|
|
||||
*/
|
||||
use AuthenticatesUsers;
|
||||
//use AuthenticatesAndRegistersUsers, ThrottlesLogins;
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest', ['except' => 'logout']);
|
||||
}
|
||||
}
|
@@ -54,7 +54,7 @@ class PasswordController extends Controller
|
||||
$date = date('Y-m-d H:i:s');
|
||||
$this->validate($request, ['email' => 'required']);
|
||||
\Event::fire('reset.password', []);
|
||||
$user = User::where('email', '=', $request->only('email'))->orWhere('mobile', '=', $request->only('email'))->first();
|
||||
$user = User::where('email', '=', $request->all('email'))->orWhere('mobile', '=', $request->all('email'))->first();
|
||||
if (isset($user)) {
|
||||
$user1 = $user->email;
|
||||
//gen new code and pass
|
||||
|
72
app/Http/Controllers/Auth/RegisterController.php
Normal file
72
app/Http/Controllers/Auth/RegisterController.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users as well as their
|
||||
| validation and creation. By default this controller uses a trait to
|
||||
| provide this functionality without requiring any additional code.
|
||||
|
|
||||
*/
|
||||
use RegistersUsers;
|
||||
use AuthenticatesAndRegistersUsers;
|
||||
/**
|
||||
* Where to redirect users after registration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => 'required|max:255',
|
||||
'email' => 'required|email|max:255|unique:users',
|
||||
'password' => 'required|min:6|confirmed',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => bcrypt($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
45
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file
45
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
use ResetsPasswords;
|
||||
/**
|
||||
* Where to redirect users after resetting their password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
public function showResetForm(Request $request, $token = null)
|
||||
{
|
||||
return view('auth.reset')->with(
|
||||
['token' => $token, 'email' => $request->email]
|
||||
);
|
||||
}
|
||||
}
|
@@ -2028,5 +2028,6 @@ class DatabaseSeeder extends Seeder
|
||||
Rating::create(['id' => '2', 'name' => 'Reply Rating', 'display_order' => '1', 'allow_modification' => '1', 'rating_scale' => '5', 'rating_area' => 'Comment Area']);
|
||||
|
||||
Limit_Login::create(['id' => '1']);
|
||||
$this->call(UserSeeder::class);
|
||||
}
|
||||
}
|
||||
|
31
database/seeds/UserSeeder.php
Normal file
31
database/seeds/UserSeeder.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
use App\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class UserSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
// creating an user
|
||||
$str = 'demopass';
|
||||
$password = \Hash::make($str);
|
||||
$user = User::create([
|
||||
'first_name' => 'Demo',
|
||||
'last_name' => 'Admin',
|
||||
'email' => null,
|
||||
'user_name' => 'demo_admin',
|
||||
'password' => $password,
|
||||
'assign_group' => 1,
|
||||
'primary_dpt' => 1,
|
||||
'active' => 1,
|
||||
'role' => 'admin',
|
||||
]);
|
||||
// checking if the user have been created
|
||||
}
|
||||
}
|
5
vendor/composer/autoload_classmap.php
vendored
5
vendor/composer/autoload_classmap.php
vendored
@@ -377,7 +377,7 @@ return array(
|
||||
'PHPUnit\\Util\\Configuration' => $vendorDir . '/phpunit/phpunit/src/Util/Configuration.php',
|
||||
'PHPUnit\\Util\\ConfigurationGenerator' => $vendorDir . '/phpunit/phpunit/src/Util/ConfigurationGenerator.php',
|
||||
'PHPUnit\\Util\\ErrorHandler' => $vendorDir . '/phpunit/phpunit/src/Util/ErrorHandler.php',
|
||||
'PHPUnit\\Util\\FileLoader' => $vendorDir . '/phpunit/phpunit/src/Util/FileLoader.php',
|
||||
'PHPUnit\\Util\\FileLoader' => $vendorDir . '/phpunit/phpunit/src/Util/Fileloader.php',
|
||||
'PHPUnit\\Util\\Filesystem' => $vendorDir . '/phpunit/phpunit/src/Util/Filesystem.php',
|
||||
'PHPUnit\\Util\\Filter' => $vendorDir . '/phpunit/phpunit/src/Util/Filter.php',
|
||||
'PHPUnit\\Util\\Getopt' => $vendorDir . '/phpunit/phpunit/src/Util/Getopt.php',
|
||||
@@ -401,7 +401,7 @@ return array(
|
||||
'PHPUnit\\Util\\TestDox\\XmlResultPrinter' => $vendorDir . '/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php',
|
||||
'PHPUnit\\Util\\TextTestListRenderer' => $vendorDir . '/phpunit/phpunit/src/Util/TextTestListRenderer.php',
|
||||
'PHPUnit\\Util\\Type' => $vendorDir . '/phpunit/phpunit/src/Util/Type.php',
|
||||
'PHPUnit\\Util\\Xml' => $vendorDir . '/phpunit/phpunit/src/Util/Xml.php',
|
||||
'PHPUnit\\Util\\Xml' => $vendorDir . '/phpunit/phpunit/src/Util/XML.php',
|
||||
'PHPUnit\\Util\\XmlTestListRenderer' => $vendorDir . '/phpunit/phpunit/src/Util/XmlTestListRenderer.php',
|
||||
'PHPUnit_Framework_MockObject_MockObject' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/MockObject.php',
|
||||
'PHP_Evaluator' => $vendorDir . '/dompdf/dompdf/include/php_evaluator.cls.php',
|
||||
@@ -776,5 +776,6 @@ return array(
|
||||
'TheSeer\\Tokenizer\\TokenCollectionException' => $vendorDir . '/theseer/tokenizer/src/TokenCollectionException.php',
|
||||
'TheSeer\\Tokenizer\\Tokenizer' => $vendorDir . '/theseer/tokenizer/src/Tokenizer.php',
|
||||
'TheSeer\\Tokenizer\\XMLSerializer' => $vendorDir . '/theseer/tokenizer/src/XMLSerializer.php',
|
||||
'UserSeeder' => $baseDir . '/database/seeds/UserSeeder.php',
|
||||
'Version1079table' => $baseDir . '/database/migrations/2016_06_28_141613_version1079table.php',
|
||||
);
|
||||
|
5
vendor/composer/autoload_static.php
vendored
5
vendor/composer/autoload_static.php
vendored
@@ -1036,7 +1036,7 @@ class ComposerStaticInit598add4b9b35c76d3599603201ccdd6d
|
||||
'PHPUnit\\Util\\Configuration' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Configuration.php',
|
||||
'PHPUnit\\Util\\ConfigurationGenerator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ConfigurationGenerator.php',
|
||||
'PHPUnit\\Util\\ErrorHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ErrorHandler.php',
|
||||
'PHPUnit\\Util\\FileLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/FileLoader.php',
|
||||
'PHPUnit\\Util\\FileLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Fileloader.php',
|
||||
'PHPUnit\\Util\\Filesystem' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filesystem.php',
|
||||
'PHPUnit\\Util\\Filter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filter.php',
|
||||
'PHPUnit\\Util\\Getopt' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Getopt.php',
|
||||
@@ -1060,7 +1060,7 @@ class ComposerStaticInit598add4b9b35c76d3599603201ccdd6d
|
||||
'PHPUnit\\Util\\TestDox\\XmlResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/XmlResultPrinter.php',
|
||||
'PHPUnit\\Util\\TextTestListRenderer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TextTestListRenderer.php',
|
||||
'PHPUnit\\Util\\Type' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Type.php',
|
||||
'PHPUnit\\Util\\Xml' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Xml.php',
|
||||
'PHPUnit\\Util\\Xml' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/XML.php',
|
||||
'PHPUnit\\Util\\XmlTestListRenderer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/XmlTestListRenderer.php',
|
||||
'PHPUnit_Framework_MockObject_MockObject' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/MockObject.php',
|
||||
'PHP_Evaluator' => __DIR__ . '/..' . '/dompdf/dompdf/include/php_evaluator.cls.php',
|
||||
@@ -1435,6 +1435,7 @@ class ComposerStaticInit598add4b9b35c76d3599603201ccdd6d
|
||||
'TheSeer\\Tokenizer\\TokenCollectionException' => __DIR__ . '/..' . '/theseer/tokenizer/src/TokenCollectionException.php',
|
||||
'TheSeer\\Tokenizer\\Tokenizer' => __DIR__ . '/..' . '/theseer/tokenizer/src/Tokenizer.php',
|
||||
'TheSeer\\Tokenizer\\XMLSerializer' => __DIR__ . '/..' . '/theseer/tokenizer/src/XMLSerializer.php',
|
||||
'UserSeeder' => __DIR__ . '/../..' . '/database/seeds/UserSeeder.php',
|
||||
'Version1079table' => __DIR__ . '/../..' . '/database/migrations/2016_06_28_141613_version1079table.php',
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user