This commit is contained in:
Manish Verma
2018-08-06 10:57:02 +05:30
parent d022c193b3
commit 96c44bea1e
6 changed files with 150 additions and 126 deletions

10
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,10 @@
## Contributing
Contributions are welcome, and are accepted via pull requests. Please review these guidelines before submitting any pull requests.
* Please follow the [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and [PHP-FIG Naming Conventions](https://github.com/php-fig/fig-standards/blob/master/bylaws/007-psr-naming-conventions.md).
* Remember to follow [SemVer](http://semver.org/). If you are changing the behavior, or the public api, you may need to update the docs.
* Make sure that the current tests pass, and if you have added something new, add the tests where relevant.
* Send a coherent commit history, making sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) them before submitting.
* You may also need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts.
NOTE: StyleCI is set up to automatically check and fix any code style issues.

View File

@@ -58,9 +58,10 @@ class AuthController extends Controller
*
* @return void
*/
public function __construct(PhpMailController $PhpMailController, SocialMediaController $social)
public function __construct()
{
$this->PhpMailController = $PhpMailController;
$this->PhpMailController = new PhpMailController();
$social = new SocialMediaController();
$social->configService();
$this->middleware('guest', ['except' => ['getLogout', 'verifyOTP', 'redirectToProvider']]);
}
@@ -147,8 +148,9 @@ class AuthController extends Controller
*
* @return type Response
*/
public function postRegister(User $user, RegisterRequest $request)
public function postRegister(User $user, RegisterRequest $request, $api = false)
{
//dd($request->all());
try {
$request_array = $request->input();
$password = Hash::make($request->input('password'));
@@ -160,20 +162,20 @@ class AuthController extends Controller
} else {
$user->email = $request->input('email');
}
if ($request_array['mobile'] == '') {
if (!checkArray('mobile', $request_array)) {
$user->mobile = null;
} else {
$user->mobile = $request->input('mobile');
}
if ($request_array['code'] == '') {
if (!checkArray('code', $request_array)) {
$user->country_code = 0;
} else {
$user->country_code = $request->input('code');
}
if ($request_array['email'] != '') {
$user->user_name = $request->input('email');
if (checkArray('username', $request_array)) {
$user->user_name = checkArray('username', $request_array);
} else {
$user->user_name = $request->input('mobile');
$user->user_name = $request->input('email');
}
$user->role = 'user';
$code = str_random(60);
@@ -204,9 +206,16 @@ class AuthController extends Controller
} else {
$message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail');
}
if ($api == true) {
return ['message' => $message12, 'user' => $user->toArray()];
}
return redirect('home')->with('success', $message12);
} catch (\Exception $e) {
if ($api == true) {
throw new \Exception($e->getMessage());
}
return redirect()->back()->with('fails', $e->getMessage());
}
}
@@ -286,6 +295,7 @@ class AuthController extends Controller
*/
public function postLogin(LoginRequest $request)
{
try {
// dd($request->input());
\Event::fire('auth.login.event', []); //added 5/5/2016
// Set login attempts and login time
@@ -412,6 +422,9 @@ class AuthController extends Controller
])->with(['error' => Lang::get('lang.invalid'),
'referer' => $referer, ]);
// Increment login attempts
} catch (\Exception $e) {
return redirect()->back()->with('fails', $e->getMessage());
}
}
/**
@@ -500,11 +513,11 @@ class AuthController extends Controller
}
/**
*@category function to show verify OTP page
* @category function to show verify OTP page
*
*@param null
* @param null
*
*@return response|view
* @return response|view
*/
public function getVerifyOTP()
{
@@ -516,11 +529,11 @@ class AuthController extends Controller
}
/**
*@category function to verify OTP
* @category function to verify OTP
*
*@param $request
* @param $request
*
*@return int|string
* @return int|string
*/
public function verifyOTP(LoginRequest $request)
{

View File

@@ -7,7 +7,7 @@ use App\BaseModel;
class Priority extends BaseModel
{
public $timestamps = false;
protected $table = 'priority';
protected $table = 'ticket_priority';
protected $fillable = [
'id', 'name',
];

View File

@@ -310,7 +310,7 @@
</li>
@endforeach
@else
<?php \Event::fire('service.desk.agent.sidebar', array()); ?>
@endif

View File

@@ -166,6 +166,7 @@
<div class="form-group has-feedback @if(isset($errors)) {!! $errors->has('password') ? 'has-error' : '' !!} @endif">
{!! Form::password('password',['placeholder'=>Lang::get('lang.password'),'class' => 'form-control']) !!}
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
<?php \Event::fire('auth.login.form'); ?>
<a href="{{url('password/email')}}" style="font-size: .8em" class="pull-left">{!! Lang::get('lang.forgot_password') !!}</a>
</div>
<div class="form-group pull-left">

View File

@@ -202,7 +202,7 @@ function validate_extensions(&$results) {
} // if
$recommended_extensions = array(
'imap' => 'IMAP extension is used for connecting to mail server using IMAP settings to fetch emails in the system.'
// 'gd' => 'GD is used for image manipulation. Without it, system is not able to create thumbnails for files or manage avatars, logos and project icons. Please refer to <a href="http://www.php.net/manual/en/image.installation.php">this</a> page for installation instructions',
// 'mbstring' => 'MultiByte String is used for work with Unicode. Without it, system may not split words and string properly and you can have weird question mark characters in Recent Activities for example. Please refer to <a href="http://www.php.net/manual/en/mbstring.installation.php">this</a> page for installation instructions',
// 'curl' => 'cURL is used to support various network tasks. Please refer to <a href="http://www.php.net/manual/en/curl.installation.php">this</a> page for installation instructions',