mentors

mentors Commit Details


Date:2014-06-28 16:56:09 (10 years 6 months ago)
Author:Right Or Wrong
Branch:develop
Commit:d9d2e5efdd3975b76302ad1ff3f2c1a566dc999d
Parents: 78a95aeb8c36d8dca48d1736ed75ace2d5b33be2
Message:login stuff and password reset and reminders

Changes:

File differences

app/controllers/RemindersController.php
4040
4141
4242
43
44
43
44
4545
4646
4747
......
7070
7171
7272
73
74
73
7574
7675
7776
......
10099
101100
102101
102
103103
104104
105105
106
106
107107
108108
109109
return Redirect::back()->with('error', Lang::get($response));
case Password::REMINDER_SENT:
\Session::flash('message', 'Please check your email for information on how to reset your password.');
return Redirect::back()->with('status', Lang::get($response));
\Session::flash('message', 'Please check your email for instructions on how to reset your password');
return Redirect::to('password/remind');
}
}
//validate input here
$rules = array(
'email' => 'required|email',
'password' => 'required|password',
'password_confirmation' => 'required',
'password' => 'required|confirmed',
'token' => 'required',
);
case Password::INVALID_PASSWORD:
case Password::INVALID_TOKEN:
case Password::INVALID_USER:
\Session::flash('message', 'You have to enter the correct information to proceed');
return Redirect::back()->with('error', Lang::get($response));
case Password::PASSWORD_RESET:
echo 'Password was reset successfully';
\Session::flash('message', 'You can now login with your new credentials.');
return Redirect::to('login');
}
}
app/controllers/SessionController.php
1717
1818
1919
20
21
2022
2123
2224
......
2830
2931
3032
31
33
34
35
36
37
38
39
40
3241
33
42
3443
35
44
45
46
47
48
3649
37
50
3851
52
53
54
55
56
3957
58
4059
4160
4261
43
44
45
46
4762
4863
4964
$validator = Validator::make(Input::all(), $rules);
$remember = \Input::get('remember');
if ($validator->fails()) {
return Redirect::to('login')
->withErrors($validator)
'password' => Input::get('password')
);
if (Auth::attempt($userdata)) {
if($remember == 'yes')
{
if (Auth::attempt($userdata, true))
{
return \Redirect::to('/');
} else {
return \Redirect::to('/');
return \Redirect::to('login');
} else {
}
}else
{
if (Auth::attempt($userdata))
{
return \Redirect::to('login');
return \Redirect::to('/');
} else {
return \Redirect::to('login');
}
}
}
if (Auth::attempt(array('email' => $email, 'password' => $password), true))
{
// The user is being remembered...
}
}
public function doLogout()
app/controllers/UserController.php
8686
8787
8888
89
89
90
9091
92
9193
92
94
95
9396
97
9498
95
99
100
96101
102
97103
98
104
105
99106
107
100108
101
109
110
102111
112
103113
104
114
115
105116
117
106118
107
108
109
110
119
120
121
122
123
124
125
111126
127
112128
113
129
130
114131
132
115133
116
134
135
117136
137
118138
119
139
140
141
142
143
144
145
120146
147
121148
122149
123150
......
128155
129156
130157
131
158
159
132160
133161
134162
135163
136164
137165
138
139
140
141
166
167
168
169
170
171
172
173
174
175
176
177
178
179
142180
143
181
144182
145183
146184
147
185
148186
149187
150188
$skills = array();
if (Input::get('java') === 'Java'){}
if (Input::get('java') === 'Java')
{
array_push($skills, 'Java');
}
if (Input::get('php') === 'PHP') {}
if (Input::get('php') === 'PHP')
{
array_push($skills, 'PHP');
}
if (Input::get('python') === 'Python') {}
if (Input::get('python') === 'Python')
{
array_push($skills, 'Python');
}
if (Input::get('cplus') === 'Cplus') {}
if (Input::get('cplus') === 'Cplus')
{
array_push($skills, 'C++');
}
if (Input::get('objc') === 'Objc') {}
if (Input::get('objc') === 'Objc')
{
array_push($skills, 'Objective C');
}
if (Input::get('htmljscss') === 'Html') {}
if (Input::get('htmljscss') === 'Html')
{
array_push($skills, 'HTML JS CSS');
}
if (Input::get('android') === 'Android') {}
array_push($skills, 'Android');
if (Input::get('ux') === 'UXDesign') {}
if (Input::get('android') === 'Android')
{
array_push($skills, 'Android');
}
if (Input::get('ux') === 'UXDesign')
{
array_push($skills, 'Java');
}
if (Input::get('webapps') === 'Webapps') {}
if (Input::get('webapps') === 'Webapps')
{
array_push($skills, 'Web Apps');
}
if (Input::get('ruby') === 'Ruby') {}
if (Input::get('ruby') === 'Ruby')
{
array_push($skills, 'Ruby on Rails');
}
if (Input::get('people') === 'People') {}
if (Input::get('csharp') === 'CSharp')
{
array_push($skills, 'C#');
}
if (Input::get('people') === 'People')
{
array_push($skills, 'People Skills');
}
$skills = serialize($skills);
$user->bio = \Input::get('bio');
$user->skills = $skills;
if (\Input::hasFile('photo')) {
if (\Input::hasFile('photo'))
{
$photo = \Input::file('photo');
$filename = uniqid('profile_').'.'.$photo->getClientOriginalExtension();
$photo->move(public_path('images/users'), $filename);
$user->photo = 'images/users/'.$filename;
}
$role = UserXrefRole::create(array(
'user_id' => $user_id,
'role_id' => $group_id
));
$user_role = UserXrefRole::where('user_id', '=', $user_id)->get();
if(count($user_role))
{
$user_role->user_id = $user_id;
$user_role->role_id = $group_id;
}else
{
$user_role = UserXrefRole::create(array(
'user_id' => $user_id,
'role_id' => $group_id
));
}
$role->save();
$user_role->save();
if ($user->save())
{
return Redirect::route('users', array('user_id' => $user_id));
return Redirect::route('users', array($user_id));
}else
{
\Redirect::back('complete', array($user_id, $group_id ));
app/models/User.php
1212
1313
1414
15
1516
16
17
1718
1819
1920
......
5455
5556
5657
57
58
5859
5960
6061
6162
62
63
6364
6465
6566
6667
67
68
6869
6970
* @var string
*/
protected $table = 'users';
protected $fillable = array(
'first', 'last', 'email', 'password', 'location', 'skills', 'photo', 'bio');
'first', 'last', 'email', 'password', 'location', 'skills', 'photo', 'bio', 'remember_token');
/**
* The attributes excluded from the model's JSON form.
public function getRememberToken()
{
return $this->value;
return $this->remember_token;
}
public function setRememberToken($value)
{
$this->value = $value;
$this->remember_token = $value;
}
public function getRememberTokenName()
{
return $this->name;
return 'remember_token';
}
}
app/routes.php
3333
3434
3535
36
36
3737
3838
39
39
/**
* User Password Reminder Controller routes
*/
Route::get('password/remind', array('uses' => 'RemindersController@getRemind'));
Route::get('password/remind', array('as' => 'remind', 'uses' => 'RemindersController@getRemind'));
Route::post('password/remind', array('uses' => 'RemindersController@postRemind'));
Route::get('password/reset/{token}', array('uses' => 'RemindersController@getReset'));
Route::post('password/reset/{token}', array('uses' => 'RemindersController@postReset'));
Route::post('password/reset', array('uses' => 'RemindersController@postReset'));
app/views/login.blade.php
4141
4242
4343
44
44
45
46
47
48
4549
4650
4751
......
5660
5761
5862
59
60
61
63
64
65
6266
6367
68
6469
6570
6671
<fieldset>
<legend><h2>Please Sign In</h2></legend>
@if(Session::has('message'))
<p class="alert-success">{{ Session::get('message') }}</p>
@endif
<div class="control-group">
{{ Form::label('email', 'Email', array('class' => 'control-label')) }}
<div class="controls">
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox"> Remember me
</label>
<label class="checkbox-inline">
{{ Form::checkbox('remember', 'yes') }} Remember me
</label>
</div>
</div>
<br />
<div class="form-group">
<button class="btn btn-primary btn-large pull-left" type="submit"><span class="login-button-icon"></span>Sign in</button> &nbsp; &nbsp; &nbsp;
{{HTML::link('password/remind', 'Forgot your password?')}}
app/views/password/remind.blade.php
4242
4343
4444
45
46
45
46
47
48
4749
4850
4951
5052
5153
5254
53
55
5456
5557
5658
<fieldset>
<legend><h2>Enter Your Email</h2></legend>
@if(Session::has('message'))
<p class="alert-success">{{$errors->first('email')}}</p>
@if(Session::has('message'))
<p class="alert-success">{{ Session::get('message') }}</p>
@endif
<div class="control-group">
{{ Form::label('email', 'Email', array('class' => 'control-label')) }}
<div class="controls">
{{ Form::text('email', null, array('class' => 'form-control borderd input-large', 'span' => 'span6', 'placeholder' => 'awesome@awesome.com'))}} <p class="alert-error pull-right">{{$errors->first('email')}}</p>
{{ Form::text('email', null, array('class' => 'form-control borderd input-large', 'span' => 'span6', 'placeholder' => 'awesome@awesome.com'))}}
</div>
</div>
app/views/password/reset.blade.php
3838
3939
4040
41
41
4242
4343
4444
<div class="container padded">
<div class="col-lg-4"></div>
<div class="col-lg-4">
{{ Form::open(array('url' => 'password/remind', 'class' => 'form-horizontal'))}}
{{ Form::open(array('url' => 'password/reset', 'class' => 'form-horizontal'))}}
<fieldset>
<legend><h2>Reset Your Password</h2></legend>
app/views/users/complete.blade.php
9090
9191
9292
93
94
95
9396
9497
9598
{{ Form::checkbox('ruby', 'Ruby') }} Ruby
</label>
<label class="checkbox-inline">
{{ Form::checkbox('csharp', 'CShap') }} C#
</label>
<label class="checkbox-inline">
{{ Form::checkbox('people', 'People') }} People Skills
</label>
app/views/users/index.blade.php
2828
2929
3030
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
5431
55
32
5633
5734
5835
59
36
6037
61
62
63
38
6439
6540
6641
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
9169
9270
9371
9472
9573
74
75
76
9677
9778
9879
</ul>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-lg-6">
<h1>Get Matched With a Mentor
or Be a Mentor To Someone Today.</h1>
<p class="lead">
Learning to program can be a daunting task
especially if you have no one to help you. It doesn't have to be that way.
That is why I started <strong>mentconnect</strong>.
</p>
<p id="button-row">
{{ HTML::link('register', 'Join Now', array('class' => 'btn btn-large btn-primary proxima-bold')) }}
</p>
</div>
<div class="col-lg-6">
</div>
</div>
</div>
</header>
<div id="main">
<div class="container padded">
<div id="feature-screenshot">
<h2>Rethinking the learning process had to be done.</h2>
<h2>Let there be mentors and mentees. Let there be learning!</h2>
<p class="center-feature-sub-content">
Cut down on the amount of time you waste looking in the wrong places.
Get your questions answered by the right mentor at the right time.
Above all, get the correct advice when you need it most and finally Learn. Having a mentor go through the journey with you is the difference between success and failure - most of the time.
Most of us will agree that we spent a significant amount of time trying to learn what we have learned so far. The other fact is that most of that time went to waste because we did not know where to look or who to ask questions when we needed it most. So, today we join hands in harmony to eliminate the time wastage and focus on building the best products on the planet and beyond.
</p>
<hr />
<div id="three-points-area" class="row">
<div class="col-lg-4">
<div class="asset image-builder-build"></div>
<h3>Get Matched</h3>
<p class="three-point-body-text">
Once you register, we automatically match you with a mentor (if you are looking for one) and if no mentor is available, we add your account to the queue in the order your account was created.
</p>
</div>
<div class="col-lg-4">
<div class="asset image-builder-code"></div>
<h3>Learn To Code</h3>
<p class="three-point-body-text">
Once you are matched with an experienced mentor, you will start learning with their guidance. Get your questions answered. Contact them when you need help and save yourself a lot of time learning.
</p>
</div>
<div class="col-lg-4">
<div class="asset image-builder-deploy"></div>
<h3>Be a Mentor</h3>
<p class="three-point-body-text">
When you have learned what you need, you get an opportunity to be .. you guessed it, a mentor to someone else. This is simply a way of giving back to the community and continue learning new skills.
</p>
</div>
</div>
<div class="row">
<div class="col-lg">
<table class="table table-striped table-hover">
<thead>
<tr>
<td><strong>First</strong></td>
<td><strong>Name</strong></td>
<td><strong>Location</strong></td>
<td><strong>Bio</strong></td>
<td><strong>View</strong></td>
</tr>
</thead>
<tbody>
@foreach($users as $key => $value)
<tr>
<td>{{ $value->first }}</td>
<td>{{ $value->last }}</td>
<td>{{ $value->location }}</td>
<td>{{ $value->bio }}</td>
<td>
<a class="btn btn-small btn-primary" href="{{ URL::to('users/' . $value->id) }}">View this Nerd</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="container padded"></div>
<br /><br />
<div id="sub-footer">
<div class="container">
<div class="row">
app/views/users/profile.blade.php
44
55
66
7
7
88
99
1010
......
115115
116116
117117
118
118119
119
120
121
122
123
124120
125121
126122
127
128123
129124
130125
<head>
<meta charset="utf-8">
<!-- This file has been downloaded from Bootsnipp.com. Enjoy! -->
<title>User Profile - Mentconnect</title>
<title>{{ $user->first}}- Mentconnect</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
{{HTML::style('css/userprofile.css')}}
2Days animation workshop to be conducted
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.14934s using 13 queries.