/** @test */ public function it_returns_captcha_html() { $_SERVER['REMOTE_PORT'] = '127.0.01'; $html = captcha_img(); $this->assertContains('<img style="float: left; padding-right: 5px" id="captcha_image" src="http://localhost/securimage', $html); $this->assertContains('<script type="text/javascript" src="/vendor/securimage/securimage.js"></script>', $html); $this->assertContains('http://localhost/securimage/audio?id=', $html); $this->assertContains('/vendor/securimage/securimage_play.swf', $html); $this->assertContains('/vendor/securimage/images/audio_icon.png', $html); $this->assertContains('/vendor/securimage/images/refresh.png', $html); $this->assertContains('/vendor/securimage/images/refresh.png', $html); }
Route::post('auth/login', 'Auth\\AuthController@postLogin'); Route::get('auth/logout', 'Auth\\AuthController@getLogout'); Route::get('auth/emailexists', 'Auth\\AuthController@getEmailExists'); Route::get('auth/activate', 'Auth\\AuthController@getActivate'); // Registration routes... Route::get('auth/register', 'Auth\\AuthController@getRegister'); Route::post('auth/register', 'Auth\\AuthController@postRegister'); Route::post('auth/changepwd', 'UserController@update'); ///OD密码管理路由 Route::controllers(['password' => 'Auth\\PasswordController']); //通知功能,用于演示分页 Route::resource('announcement', 'AnnouncementController'); ///Captcha Route::any('captcha', function () { if (Request::getMethod() == 'POST') { $rules = ['captcha' => 'required|captcha']; $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { echo '<p style="color: #ff0000;">Incorrect!</p>'; } else { echo '<p style="color: #00ff30;">Matched :)</p>'; } } $form = '<form method="post" action="captcha">'; $form .= '<input type="hidden" name="_token" value="' . csrf_token() . '">'; $form .= '<p>' . captcha_img() . '</p>'; $form .= '<p><input type="text" name="captcha"></p>'; $form .= '<p><button type="submit" name="check">Check</button></p>'; $form .= '</form>'; return $form; });
<div class="inline field"> <label id="b-label">邮 箱:</label> <input type="text" placeholder="请输入邮箱" name="email" style="width:400px;"> </div> <div class="inline field"> <label id="b-label">手 机 号 码:</label> <input type="text" placeholder="请输入你的手机号" name="mobile" style="width:400px;"> </div> <div class="inline fields"> <div class="field"> <label id="b-label">验 证 码:</label> <input type="text" placeholder="" name="captcha" style="width:200px;"> </div> <div onclick="load_captcha_img(this)" class="field"> <?php echo captcha_img(); ?> </div> </div> <div class="inline field"> <label id="b-label">设 置 密 码:</label> <input type="password" name="password" placeholder="请输入密码" style="width:400px;"> </div> <div class="inline field"> <label id="b-label">确 认 密 码:</label> <input type="password" name="password_confirmation" placeholder="请再一次输入密码" style="width:400px;"> </div> <div class="inline field"> <div class="ui checkbox" id="b-check"> <input type="checkbox" checked="checked" name="agreement" value="1"> <label><a target="_blank" href="<?php
<div class="form-group"> {!! Form::label('email', 'Email Address') !!} {!! Form::text('email',Input::old('email'),['class'=>'form-control']) !!} <hr/> </div> <div class="form-group"> {!! Form::label('password', 'Password: '******'password',null,['class'=>'form-control']) !!} </div> <div class="form-group"> {!! Form::label('password_confirmation', 'Confirm Password: '******'password_confirmation',null,['class'=>'form-control']) !!} </div> <?php echo '<input type="hidden" name="_token" value="' . csrf_token() . '"><p>' . captcha_img() . '</p>' . '<p><input class="form-control" type="text" name="captcha"></p>'; ?> <div class="form-group"> {!! Form::submit('Register',['class'=>'btn btn-primary form-control']) !!} </div> {!! Form::close() !!} <br/> {{--<strong><a href="">Register</a>|<a href="">Forgot Password</a><strong>--}} @stop
Route::get('auth/register', 'Auth\\AuthController@getRegister'); Route::post('auth/register', 'Auth\\AuthController@postRegister'); Route::group(['prefix' => 'admin', 'namespace' => 'Admin', 'middleware' => 'auth'], function () { Route::get('/', 'AdminHomeController@index'); Route::resource('pages', 'PagesController'); Route::resource('comments', 'CommentsController'); Route::resource('articles', 'ArticlesController'); }); Route::post('comment/store', 'CommentsController@store'); //articles 前台 Route::get('/articles', 'ArticlesController@index'); Route::get('/articles/{id}', 'ArticlesController@show'); //captcha Route::any('captcha-test', function () { if (Request::getMethod() == 'POST') { $rules = ['captcha' => 'required|captcha']; $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { echo '<p style="color: #ff0000;">Incorrect!</p>'; } else { echo '<p style="color: #00ff30;">Matched :)</p>'; } } $form = '<form method="post" action="captcha-test">'; $form .= '<input type="hidden" name="_token" value="' . csrf_token() . '">'; $form .= '<p>' . captcha_img('mini') . '</p>'; $form .= '<p><input type="text" name="captcha"></p>'; $form .= '<p><button type="submit" name="check">Check</button></p>'; $form .= '</form>'; return $form; });