├── .bowerrc
├── .gitattributes
├── .gitignore
├── Gruntfile.js
├── LICENSE.md
├── README.md
├── app
├── commands
│ ├── .gitkeep
│ ├── CheckCommand.php
│ └── DeployCommand.php
├── config
│ ├── app.php
│ ├── auth.php
│ ├── cache.php
│ ├── compile.php
│ ├── database.php
│ ├── development
│ │ └── .gitignore
│ ├── mail.php
│ ├── packages
│ │ └── artdarek
│ │ │ └── oauth-4-laravel
│ │ │ ├── .gitkeep
│ │ │ ├── config.php
│ │ │ └── development
│ │ │ └── config.php
│ ├── queue.php
│ ├── remote.php
│ ├── session.php
│ ├── testing
│ │ ├── cache.php
│ │ └── session.php
│ ├── view.php
│ └── workbench.php
├── controllers
│ ├── .gitkeep
│ ├── ApiController.php
│ ├── BaseController.php
│ ├── CheckController.php
│ ├── CompanyController.php
│ ├── HomeController.php
│ └── UserController.php
├── database
│ ├── migrations
│ │ ├── .gitkeep
│ │ ├── 2013_03_02_222737_migration_cartalyst_sentry_install_users.php
│ │ ├── 2013_03_02_222738_migration_cartalyst_sentry_install_groups.php
│ │ ├── 2013_03_02_222739_migration_cartalyst_sentry_install_users_groups_pivot.php
│ │ ├── 2013_03_02_222740_migration_cartalyst_sentry_install_throttle.php
│ │ ├── 2013_12_22_184132_init.php
│ │ ├── 2014_01_23_145524_oauth_login.php
│ │ └── 2015_01_06_115830_create_failed_jobs_table.php
│ ├── production.sqlite
│ └── seeds
│ │ ├── .gitkeep
│ │ ├── CheckSeeder.php
│ │ ├── CompanySeeder.php
│ │ ├── DevelopmentSeeder.php
│ │ ├── InstallSeeder.php
│ │ └── UserSeeder.php
├── filters.php
├── jobs
│ └── CheckWebsite.php
├── lang
│ ├── de
│ │ ├── base.php
│ │ ├── check.php
│ │ ├── company.php
│ │ ├── dashboard.php
│ │ ├── home.php
│ │ ├── user.php
│ │ └── validation.php
│ └── en
│ │ ├── base.php
│ │ ├── check.php
│ │ ├── company.php
│ │ ├── dashboard.php
│ │ ├── home.php
│ │ ├── user.php
│ │ └── validation.php
├── models
│ ├── Check.php
│ ├── CheckResult.php
│ ├── Company.php
│ ├── User.php
│ ├── UserCompany.php
│ └── UserGitHub.php
├── routes.php
├── start
│ ├── artisan.php
│ ├── global.php
│ └── local.php
├── storage
│ ├── .gitignore
│ ├── cache
│ │ └── .gitignore
│ ├── logs
│ │ └── .gitignore
│ ├── meta
│ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
├── tests
│ ├── ExampleTest.php
│ └── TestCase.php
└── views
│ ├── check
│ ├── _form.blade.php
│ ├── create.blade.php
│ ├── edit.blade.php
│ ├── index.blade.php
│ └── show.blade.php
│ ├── company
│ ├── _form.blade.php
│ ├── create.blade.php
│ ├── edit.blade.php
│ ├── index.blade.php
│ └── show.blade.php
│ ├── email
│ ├── activate.blade.php
│ └── check
│ │ ├── offline.blade.php
│ │ └── online.blade.php
│ ├── home
│ └── index.blade.php
│ ├── layouts
│ ├── email.blade.php
│ └── master.blade.php
│ ├── site
│ └── en
│ │ ├── imprint.blade.php
│ │ └── privacy.blade.php
│ └── user
│ ├── account.blade.php
│ ├── login.blade.php
│ ├── register.blade.php
│ └── social.blade.php
├── artisan
├── bootstrap
├── autoload.php
├── paths.php
└── start.php
├── bower.json
├── composer.json
├── composer.lock
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── css
│ └── .gitignore
├── favicon.ico
├── index.php
├── js
│ ├── .gitignore
│ └── main.js
├── less
│ └── main.less
├── packages
│ └── .gitkeep
└── robots.txt
├── queue.sh
└── server.php
/.bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "public/js/vendor"
3 | }
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /app/config/*
2 | /bootstrap/compiled.php
3 | /node_modules
4 | /public/js/vendor
5 | /vendor
6 |
7 | *.sublime-*
8 |
9 | ping.log
10 | ping_error.log
11 | queue.pid
12 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | module.exports = function(grunt) {
2 | grunt.initConfig({
3 | pkg: grunt.file.readJSON('package.json'),
4 | chmod: {
5 | options: {
6 | mode: '777'
7 | },
8 | storage: {
9 | src: [
10 | 'app/storage/cache',
11 | 'app/storage/logs',
12 | 'app/storage/meta',
13 | 'app/storage/sessions',
14 | 'app/storage/views',
15 | ]
16 | }
17 | },
18 | less: {
19 | main: {
20 | options: {
21 | paths: ['public/less']
22 | },
23 | files: {
24 | 'public/css/main.min.css': 'public/less/main.less'
25 | }
26 | }
27 | },
28 | uglify: {
29 | options: {
30 | sourceMap: true
31 | },
32 | app: {
33 | files: {
34 | 'public/js/main.min.js': [
35 | 'public/js/main.js'
36 | ]
37 | }
38 | }
39 | },
40 | shell: {
41 | install: {
42 | command: [
43 | 'php artisan migrate --package=cartalyst/sentry',
44 | 'php artisan migrate',
45 | 'php artisan db:seed --class="InstallSeeder"'
46 | ].join(' && ')
47 | },
48 | seed: {
49 | command: 'php artisan db:seed --class=DevelopmentSeeder'
50 | }
51 | }
52 | });
53 |
54 | grunt.loadNpmTasks('grunt-chmod');
55 | grunt.loadNpmTasks('grunt-shell');
56 | grunt.loadNpmTasks('grunt-contrib-uglify');
57 | grunt.loadNpmTasks('grunt-contrib-less');
58 |
59 | grunt.registerTask('install', ['chmod', 'shell:install']);
60 | grunt.registerTask('seed', ['shell:seed']);
61 | grunt.registerTask('build', ['less', 'uglify']);
62 | grunt.registerTask('default', ['build']);
63 | };
64 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 VisualAppeal
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://insight.sensiolabs.com/account/widget?project=d1c84f2e-5a58-465e-b49c-3d72f1f4c683)
2 |
3 | This application monitors the uptime by making cURL requests to a defined set of websites and display the data in charts.
4 |
5 | The only languages currently available are english and german. You can edit the language files in `app/lang/[2_LETTER_COUNTRY_CODE]/*.php`. Just copy the english/german translation and edit the files. Pull requests are welcomed.
6 |
7 | ## Requirements
8 |
9 | * npm (node.js package manger)
10 |
11 | ## Screenshots
12 |
13 | 
14 | 
15 | 
16 |
17 | ## Configuration
18 |
19 | In the future there might be an installer.
20 |
21 | Set the environment variable `APPLICATION_ENV` to a value which is unequal `testing`, e.g. `development` or `production`. Create the folder `app/config/[APPLICATION_ENV]`. All config files in this directory will be merged with the config files in `app/config`. The most important files are `database.php` and `app.php` which should similar to this:
22 |
23 | ```php
24 | array(
29 | 'app' => array(
30 | 'driver' => 'mysql',
31 | 'host' => 'localhost',
32 | 'database' => 'ping_database',
33 | 'username' => 'ping_database_user',
34 | 'password' => 'ping_database_user_password',
35 | 'charset' => 'utf8',
36 | 'collation' => 'utf8_unicode_ci',
37 | 'prefix' => 'ping_',
38 | ),
39 | ),
40 | );
41 | ```
42 |
43 | ```php
44 | array(
49 | 'datetime' => 'd/m/Y H:i', // see http://php.net/date
50 | ),
51 | 'url' => 'http://127.0.0.1/ping/public',
52 | 'locale' => 'en',
53 | 'timezone' => 'Europe/Berlin',
54 | 'key' => '' // 32 random alphanumeric chars
55 | );
56 | ```
57 |
58 | For a normal installation you should create an `auth.php` which will create a admin after installation:
59 |
60 | ```php
61 | array(
66 | 'email' => 'email@example.com',
67 | 'password' => '123456',
68 | ),
69 | );
70 | ```
71 |
72 | ## Installation
73 |
74 | 1. Clone the repository
75 | 2. Create your config
76 | 4. `php artisan migrate --package=cartalyst/sentry`
77 | 5. `php artisan migrate`
78 | 6. `grunt build`
79 | 4. visit http://url-to-repository/public
80 |
81 | ## ToDo
82 |
83 | * Dashboard!
84 | * Search in body for string when checking uptime
85 | * Fix translation issues
86 | * Unit Tests
87 |
88 | ## Contributors, Credits and libraries
89 |
90 | * Framework: http://laravel.com/
91 | * User management: https://cartalyst.com/manual/sentry
92 | * Uptime check: https://github.com/rmccue/Requests/
93 | * Favicon: http://www.iconarchive.com/show/ivista-2-icons-by-gakuseisean/Files-Upload-File-icon.html
94 |
--------------------------------------------------------------------------------
/app/commands/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualAppeal/ping-laravel/270bf48d9b36fa6d802daf36383c884e1c9b6b1c/app/commands/.gitkeep
--------------------------------------------------------------------------------
/app/commands/CheckCommand.php:
--------------------------------------------------------------------------------
1 | get();
40 |
41 | foreach ($checks as $check) {
42 | $hasChecked = CheckResult::where('check_id', '=', $check->id)
43 | ->where('created_at', '>', date('Y-m-d H:i:s', (time() - $check->interval * 60)))
44 | ->count();
45 |
46 | if ($hasChecked == 0) {
47 | Queue::push('CheckWebsite', $check->id);
48 | }
49 | }
50 | }
51 |
52 | /**
53 | * Get the console command arguments.
54 | *
55 | * @return array
56 | */
57 | protected function getArguments()
58 | {
59 | return array();
60 | }
61 |
62 | /**
63 | * Get the console command options.
64 | *
65 | * @return array
66 | */
67 | protected function getOptions()
68 | {
69 | return array();
70 | }
71 | }
--------------------------------------------------------------------------------
/app/commands/DeployCommand.php:
--------------------------------------------------------------------------------
1 | argument('remote');
47 | $config = app()->config['remote.connections.'.$remote];
48 |
49 | $commands = array(
50 | 'cd ' . $config['root'],
51 | 'php artisan down',
52 | 'git fetch --all',
53 | 'git reset --hard origin/master',
54 | 'composer install --optimize-autoloader --no-dev',
55 | 'php artisan migrate --package=cartalyst/sentry --force',
56 | 'php artisan migrate --force',
57 | 'grunt build',
58 | 'php artisan cache:clear',
59 | 'php artisan up',
60 | );
61 |
62 | SSH::into($remote)->run(
63 | $commands,
64 | function($line) use ($me) {
65 | $me->info($line);
66 | }
67 | );
68 |
69 | $this->info('All done!');
70 | }
71 |
72 | /**
73 | * Get the console command arguments.
74 | *
75 | * @return array
76 | */
77 | protected function getArguments()
78 | {
79 | return array(
80 | array('remote', InputArgument::OPTIONAL, 'Define which remote to connect to.', 'production'),
81 | );
82 | }
83 |
84 | /**
85 | * Get the console command options.
86 | *
87 | * @return array
88 | */
89 | protected function getOptions()
90 | {
91 | return array(
92 | array('update', null, InputOption::VALUE_NONE, 'Execute update after deployment.', null),
93 | array('migrate', null, InputOption::VALUE_NONE, 'Execute php artisan migrate.', null),
94 | );
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/app/config/app.php:
--------------------------------------------------------------------------------
1 | true,
5 |
6 | /*
7 | |--------------------------------------------------------------------------
8 | | Application Debug Mode
9 | |--------------------------------------------------------------------------
10 | |
11 | | When your application is in debug mode, detailed error messages with
12 | | stack traces will be shown on every error that occurs within your
13 | | application. If disabled, a simple generic error page is shown.
14 | |
15 | */
16 |
17 | 'debug' => true,
18 |
19 | /*
20 | |--------------------------------------------------------------------------
21 | | Application URL
22 | |--------------------------------------------------------------------------
23 | |
24 | | This URL is used by the console to properly generate URLs when using
25 | | the Artisan command line tool. You should set this to the root of
26 | | your application so that it is used when running Artisan tasks.
27 | |
28 | */
29 |
30 | 'url' => 'http://localhost',
31 |
32 | /*
33 | |--------------------------------------------------------------------------
34 | | Application Timezone
35 | |--------------------------------------------------------------------------
36 | |
37 | | Here you may specify the default timezone for your application, which
38 | | will be used by the PHP date and date-time functions. We have gone
39 | | ahead and set this to a sensible default for you out of the box.
40 | |
41 | */
42 |
43 | 'timezone' => 'UTC',
44 |
45 | /*
46 | |--------------------------------------------------------------------------
47 | | Application Locale Configuration
48 | |--------------------------------------------------------------------------
49 | |
50 | | The application locale determines the default locale that will be used
51 | | by the translation service provider. You are free to set this value
52 | | to any of the locales which will be supported by the application.
53 | |
54 | */
55 |
56 | 'locale' => 'en',
57 |
58 | /*
59 | |--------------------------------------------------------------------------
60 | | Encryption Key
61 | |--------------------------------------------------------------------------
62 | |
63 | | This key is used by the Illuminate encrypter service and should be set
64 | | to a random, 32 character string, otherwise these encrypted strings
65 | | will not be safe. Please do this before deploying an application!
66 | |
67 | */
68 |
69 | 'key' => '',
70 |
71 | /*
72 | |--------------------------------------------------------------------------
73 | | Autoloaded Service Providers
74 | |--------------------------------------------------------------------------
75 | |
76 | | The service providers listed here will be automatically loaded on the
77 | | request to your application. Feel free to add your own services to
78 | | this array to grant expanded functionality to your applications.
79 | |
80 | */
81 |
82 | 'providers' => array(
83 | 'Illuminate\Foundation\Providers\ArtisanServiceProvider',
84 | 'Illuminate\Auth\AuthServiceProvider',
85 | 'Illuminate\Cache\CacheServiceProvider',
86 | 'Illuminate\Session\CommandsServiceProvider',
87 | 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
88 | 'Illuminate\Routing\ControllerServiceProvider',
89 | 'Illuminate\Cookie\CookieServiceProvider',
90 | 'Illuminate\Database\DatabaseServiceProvider',
91 | 'Illuminate\Encryption\EncryptionServiceProvider',
92 | 'Illuminate\Filesystem\FilesystemServiceProvider',
93 | 'Illuminate\Hashing\HashServiceProvider',
94 | 'Illuminate\Html\HtmlServiceProvider',
95 | 'Illuminate\Log\LogServiceProvider',
96 | 'Illuminate\Mail\MailServiceProvider',
97 | 'Illuminate\Database\MigrationServiceProvider',
98 | 'Illuminate\Pagination\PaginationServiceProvider',
99 | 'Illuminate\Queue\QueueServiceProvider',
100 | 'Illuminate\Redis\RedisServiceProvider',
101 | 'Illuminate\Remote\RemoteServiceProvider',
102 | 'Illuminate\Auth\Reminders\ReminderServiceProvider',
103 | 'Illuminate\Database\SeedServiceProvider',
104 | 'Illuminate\Session\SessionServiceProvider',
105 | 'Illuminate\Translation\TranslationServiceProvider',
106 | 'Illuminate\Validation\ValidationServiceProvider',
107 | 'Illuminate\View\ViewServiceProvider',
108 | 'Illuminate\Workbench\WorkbenchServiceProvider',
109 | 'Cartalyst\Sentry\SentryServiceProvider',
110 | 'Artdarek\OAuth\OAuthServiceProvider',
111 | ),
112 |
113 | /*
114 | |--------------------------------------------------------------------------
115 | | Service Provider Manifest
116 | |--------------------------------------------------------------------------
117 | |
118 | | The service provider manifest is used by Laravel to lazy load service
119 | | providers which are not needed for each request, as well to keep a
120 | | list of all of the services. Here, you may set its storage spot.
121 | |
122 | */
123 |
124 | 'manifest' => storage_path().'/meta',
125 |
126 | /*
127 | |--------------------------------------------------------------------------
128 | | Class Aliases
129 | |--------------------------------------------------------------------------
130 | |
131 | | This array of class aliases will be registered when this application
132 | | is started. However, feel free to register as many as you wish as
133 | | the aliases are "lazy" loaded so they don't hinder performance.
134 | |
135 | */
136 |
137 | 'aliases' => array(
138 | 'App' => 'Illuminate\Support\Facades\App',
139 | 'Artisan' => 'Illuminate\Support\Facades\Artisan',
140 | 'Auth' => 'Illuminate\Support\Facades\Auth',
141 | 'Blade' => 'Illuminate\Support\Facades\Blade',
142 | 'Cache' => 'Illuminate\Support\Facades\Cache',
143 | 'ClassLoader' => 'Illuminate\Support\ClassLoader',
144 | 'Config' => 'Illuminate\Support\Facades\Config',
145 | 'Controller' => 'Illuminate\Routing\Controller',
146 | 'Cookie' => 'Illuminate\Support\Facades\Cookie',
147 | 'Crypt' => 'Illuminate\Support\Facades\Crypt',
148 | 'DB' => 'Illuminate\Support\Facades\DB',
149 | 'Eloquent' => 'Illuminate\Database\Eloquent\Model',
150 | 'Event' => 'Illuminate\Support\Facades\Event',
151 | 'File' => 'Illuminate\Support\Facades\File',
152 | 'Form' => 'Illuminate\Support\Facades\Form',
153 | 'Hash' => 'Illuminate\Support\Facades\Hash',
154 | 'HTML' => 'Illuminate\Support\Facades\HTML',
155 | 'Input' => 'Illuminate\Support\Facades\Input',
156 | 'Lang' => 'Illuminate\Support\Facades\Lang',
157 | 'Log' => 'Illuminate\Support\Facades\Log',
158 | 'Mail' => 'Illuminate\Support\Facades\Mail',
159 | 'Paginator' => 'Illuminate\Support\Facades\Paginator',
160 | 'Password' => 'Illuminate\Support\Facades\Password',
161 | 'Queue' => 'Illuminate\Support\Facades\Queue',
162 | 'Redirect' => 'Illuminate\Support\Facades\Redirect',
163 | 'Redis' => 'Illuminate\Support\Facades\Redis',
164 | 'Request' => 'Illuminate\Support\Facades\Request',
165 | 'Response' => 'Illuminate\Support\Facades\Response',
166 | 'Route' => 'Illuminate\Support\Facades\Route',
167 | 'Schema' => 'Illuminate\Support\Facades\Schema',
168 | 'Seeder' => 'Illuminate\Database\Seeder',
169 | 'Session' => 'Illuminate\Support\Facades\Session',
170 | 'SSH' => 'Illuminate\Support\Facades\SSH',
171 | 'Str' => 'Illuminate\Support\Str',
172 | 'URL' => 'Illuminate\Support\Facades\URL',
173 | 'Validator' => 'Illuminate\Support\Facades\Validator',
174 | 'View' => 'Illuminate\Support\Facades\View',
175 | 'Sentry' => 'Cartalyst\Sentry\Facades\Laravel\Sentry',
176 | 'OAuth' => 'Artdarek\OAuth\Facade\OAuth',
177 | ),
178 |
179 | );
180 |
--------------------------------------------------------------------------------
/app/config/auth.php:
--------------------------------------------------------------------------------
1 | 'eloquent',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Authentication Model
23 | |--------------------------------------------------------------------------
24 | |
25 | | When using the "Eloquent" authentication driver, we need to know which
26 | | Eloquent model should be used to retrieve your users. Of course, it
27 | | is often just the "User" model but you may use whatever you like.
28 | |
29 | */
30 |
31 | 'model' => 'User',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Authentication Table
36 | |--------------------------------------------------------------------------
37 | |
38 | | When using the "Database" authentication driver, we need to know which
39 | | table should be used to retrieve your users. We have chosen a basic
40 | | default value but you may easily change it to any table you like.
41 | |
42 | */
43 |
44 | 'table' => 'users',
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Password Reminder Settings
49 | |--------------------------------------------------------------------------
50 | |
51 | | Here you may set the settings for password reminders, including a view
52 | | that should be used as your password reminder e-mail. You will also
53 | | be able to set the name of the table that holds the reset tokens.
54 | |
55 | | The "expire" time is the number of minutes that the reminder should be
56 | | considered valid. This security feature keeps tokens short-lived so
57 | | they have less time to be guessed. You may change this as needed.
58 | |
59 | */
60 |
61 | 'reminder' => array(
62 |
63 | 'email' => 'emails.auth.reminder',
64 |
65 | 'table' => 'password_reminders',
66 |
67 | 'expire' => 60,
68 |
69 | ),
70 |
71 | );
72 |
--------------------------------------------------------------------------------
/app/config/cache.php:
--------------------------------------------------------------------------------
1 | 'file',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | File Cache Location
23 | |--------------------------------------------------------------------------
24 | |
25 | | When using the "file" cache driver, we need a location where the cache
26 | | files may be stored. A sensible default has been specified, but you
27 | | are free to change it to any other place on disk that you desire.
28 | |
29 | */
30 |
31 | 'path' => storage_path().'/cache',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | Database Cache Connection
36 | |--------------------------------------------------------------------------
37 | |
38 | | When using the "database" cache driver you may specify the connection
39 | | that should be used to store the cached items. When this option is
40 | | null the default database connection will be utilized for cache.
41 | |
42 | */
43 |
44 | 'connection' => null,
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Database Cache Table
49 | |--------------------------------------------------------------------------
50 | |
51 | | When using the "database" cache driver we need to know the table that
52 | | should be used to store the cached items. A default table name has
53 | | been provided but you're free to change it however you deem fit.
54 | |
55 | */
56 |
57 | 'table' => 'cache',
58 |
59 | /*
60 | |--------------------------------------------------------------------------
61 | | Memcached Servers
62 | |--------------------------------------------------------------------------
63 | |
64 | | Now you may specify an array of your Memcached servers that should be
65 | | used when utilizing the Memcached cache driver. All of the servers
66 | | should contain a value for "host", "port", and "weight" options.
67 | |
68 | */
69 |
70 | 'memcached' => array(
71 |
72 | array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
73 |
74 | ),
75 |
76 | /*
77 | |--------------------------------------------------------------------------
78 | | Cache Key Prefix
79 | |--------------------------------------------------------------------------
80 | |
81 | | When utilizing a RAM based store such as APC or Memcached, there might
82 | | be other applications utilizing the same cache. So, we'll specify a
83 | | value to get prefixed to all our keys so we can avoid collisions.
84 | |
85 | */
86 |
87 | 'prefix' => 'laravel',
88 |
89 | );
90 |
--------------------------------------------------------------------------------
/app/config/compile.php:
--------------------------------------------------------------------------------
1 | PDO::FETCH_CLASS,
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Database Connection Name
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may specify which of the database connections below you wish
24 | | to use as your default connection for all database work. Of course
25 | | you may use many connections at once using the Database library.
26 | |
27 | */
28 |
29 | 'default' => 'app',
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Database Connections
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here are each of the database connections setup for your application.
37 | | Of course, examples of configuring each database platform that is
38 | | supported by Laravel is shown below to make development simple.
39 | |
40 | |
41 | | All database work in Laravel is done through the PHP PDO facilities
42 | | so make sure you have the driver for your particular database of
43 | | choice installed on your machine before you begin development.
44 | |
45 | */
46 |
47 | 'connections' => array(
48 | ),
49 |
50 | /*
51 | |--------------------------------------------------------------------------
52 | | Migration Repository Table
53 | |--------------------------------------------------------------------------
54 | |
55 | | This table keeps track of all the migrations that have already run for
56 | | your application. Using this information, we can determine which of
57 | | the migrations on disk haven't actually been run in the database.
58 | |
59 | */
60 |
61 | 'migrations' => 'migrations',
62 |
63 | /*
64 | |--------------------------------------------------------------------------
65 | | Redis Databases
66 | |--------------------------------------------------------------------------
67 | |
68 | | Redis is an open source, fast, and advanced key-value store that also
69 | | provides a richer set of commands than a typical key-value systems
70 | | such as APC or Memcached. Laravel makes it easy to dig right in.
71 | |
72 | */
73 |
74 | 'redis' => array(
75 |
76 | 'cluster' => false,
77 |
78 | 'default' => array(
79 | 'host' => '127.0.0.1',
80 | 'port' => 6379,
81 | 'database' => 0,
82 | ),
83 |
84 | ),
85 |
86 | );
87 |
--------------------------------------------------------------------------------
/app/config/development/.gitignore:
--------------------------------------------------------------------------------
1 | !.gitignore
2 | *
--------------------------------------------------------------------------------
/app/config/mail.php:
--------------------------------------------------------------------------------
1 | 'smtp',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | SMTP Host Address
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may provide the host address of the SMTP server used by your
26 | | applications. A default option is provided that is compatible with
27 | | the Postmark mail service, which will provide reliable delivery.
28 | |
29 | */
30 |
31 | 'host' => 'smtp.mailgun.org',
32 |
33 | /*
34 | |--------------------------------------------------------------------------
35 | | SMTP Host Port
36 | |--------------------------------------------------------------------------
37 | |
38 | | This is the SMTP port used by your application to delivery e-mails to
39 | | users of your application. Like the host we have set this value to
40 | | stay compatible with the Postmark e-mail application by default.
41 | |
42 | */
43 |
44 | 'port' => 587,
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Global "From" Address
49 | |--------------------------------------------------------------------------
50 | |
51 | | You may wish for all e-mails sent by your application to be sent from
52 | | the same address. Here, you may specify a name and address that is
53 | | used globally for all e-mails that are sent by your application.
54 | |
55 | */
56 |
57 | 'from' => array('address' => null, 'name' => null),
58 |
59 | /*
60 | |--------------------------------------------------------------------------
61 | | E-Mail Encryption Protocol
62 | |--------------------------------------------------------------------------
63 | |
64 | | Here you may specify the encryption protocol that should be used when
65 | | the application send e-mail messages. A sensible default using the
66 | | transport layer security protocol should provide great security.
67 | |
68 | */
69 |
70 | 'encryption' => 'tls',
71 |
72 | /*
73 | |--------------------------------------------------------------------------
74 | | SMTP Server Username
75 | |--------------------------------------------------------------------------
76 | |
77 | | If your SMTP server requires a username for authentication, you should
78 | | set it here. This will get used to authenticate with your server on
79 | | connection. You may also set the "password" value below this one.
80 | |
81 | */
82 |
83 | 'username' => null,
84 |
85 | /*
86 | |--------------------------------------------------------------------------
87 | | SMTP Server Password
88 | |--------------------------------------------------------------------------
89 | |
90 | | Here you may set the password required by your SMTP server to send out
91 | | messages from your application. This will be given to the server on
92 | | connection so that the application will be able to send messages.
93 | |
94 | */
95 |
96 | 'password' => null,
97 |
98 | /*
99 | |--------------------------------------------------------------------------
100 | | Sendmail System Path
101 | |--------------------------------------------------------------------------
102 | |
103 | | When using the "sendmail" driver to send e-mails, we will need to know
104 | | the path to where Sendmail lives on this server. A default path has
105 | | been provided here, which will work well on most of your systems.
106 | |
107 | */
108 |
109 | 'sendmail' => '/usr/sbin/sendmail -bs',
110 |
111 | /*
112 | |--------------------------------------------------------------------------
113 | | Mail "Pretend"
114 | |--------------------------------------------------------------------------
115 | |
116 | | When this option is enabled, e-mail will not actually be sent over the
117 | | web and will instead be written to your application's logs files so
118 | | you may inspect the message. This is great for local development.
119 | |
120 | */
121 |
122 | 'pretend' => false,
123 |
124 | );
--------------------------------------------------------------------------------
/app/config/packages/artdarek/oauth-4-laravel/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualAppeal/ping-laravel/270bf48d9b36fa6d802daf36383c884e1c9b6b1c/app/config/packages/artdarek/oauth-4-laravel/.gitkeep
--------------------------------------------------------------------------------
/app/config/packages/artdarek/oauth-4-laravel/config.php:
--------------------------------------------------------------------------------
1 | 'Session',
5 | );
--------------------------------------------------------------------------------
/app/config/packages/artdarek/oauth-4-laravel/development/config.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'GitHub' => array(
6 | 'client_id' => 'c531b64426ca6f3990a5',
7 | 'client_secret' => 'af86f65d5dee67b6c32f0e17ceed7c4f148eb83e',
8 | 'scope' => array('user:email'),
9 | ),
10 | ),
11 | );
--------------------------------------------------------------------------------
/app/config/queue.php:
--------------------------------------------------------------------------------
1 | 'sync',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Queue Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may configure the connection information for each server that
26 | | is used by your application. A default configuration has been added
27 | | for each back-end shipped with Laravel. You are free to add more.
28 | |
29 | */
30 |
31 | 'connections' => array(
32 | 'sync' => array(
33 | 'driver' => 'sync',
34 | ),
35 |
36 | 'beanstalkd' => array(
37 | 'driver' => 'beanstalkd',
38 | 'host' => 'localhost',
39 | 'queue' => 'default',
40 | ),
41 |
42 | 'sqs' => array(
43 | 'driver' => 'sqs',
44 | 'key' => 'your-public-key',
45 | 'secret' => 'your-secret-key',
46 | 'queue' => 'your-queue-url',
47 | 'region' => 'us-east-1',
48 | ),
49 |
50 | 'iron' => array(
51 | 'driver' => 'iron',
52 | 'project' => 'your-project-id',
53 | 'token' => 'your-token',
54 | 'queue' => 'your-queue-name',
55 | ),
56 |
57 | 'redis' => array(
58 | 'driver' => 'redis',
59 | 'queue' => 'default',
60 | ),
61 | ),
62 |
63 | /*
64 | |--------------------------------------------------------------------------
65 | | Failed Queue Jobs
66 | |--------------------------------------------------------------------------
67 | |
68 | | These options configure the behavior of failed queue job logging so you
69 | | can control which database and table are used to store the jobs that
70 | | have failed. You may change them to any database / table you wish.
71 | |
72 | */
73 |
74 | 'failed' => array(
75 | 'database' => 'app',
76 | 'table' => 'failed_jobs',
77 | ),
78 |
79 | );
80 |
--------------------------------------------------------------------------------
/app/config/remote.php:
--------------------------------------------------------------------------------
1 | 'production',
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Remote Server Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | These are the servers that will be accessible via the SSH task runner
24 | | facilities of Laravel. This feature radically simplifies executing
25 | | tasks on your servers, such as deploying out these applications.
26 | |
27 | */
28 |
29 | 'connections' => array(
30 | 'production' => array(
31 | 'host' => '',
32 | 'username' => '',
33 | 'password' => '',
34 | 'key' => '',
35 | 'keyphrase' => '',
36 | 'root' => '/var/www',
37 | ),
38 | ),
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Remote Server Groups
43 | |--------------------------------------------------------------------------
44 | |
45 | | Here you may list connections under a single group name, which allows
46 | | you to easily access all of the servers at once using a short name
47 | | that is extremely easy to remember, such as "web" or "database".
48 | |
49 | */
50 |
51 | 'groups' => array(
52 | 'web' => array('production')
53 | ),
54 |
55 | );
--------------------------------------------------------------------------------
/app/config/session.php:
--------------------------------------------------------------------------------
1 | 'file',
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Session Lifetime
24 | |--------------------------------------------------------------------------
25 | |
26 | | Here you may specify the number of minutes that you wish the session
27 | | to be allowed to remain idle before it expires. If you want them
28 | | to immediately expire on the browser closing, set that option.
29 | |
30 | */
31 |
32 | 'lifetime' => 120,
33 |
34 | 'expire_on_close' => false,
35 |
36 | /*
37 | |--------------------------------------------------------------------------
38 | | Session File Location
39 | |--------------------------------------------------------------------------
40 | |
41 | | When using the native session driver, we need a location where session
42 | | files may be stored. A default has been set for you but a different
43 | | location may be specified. This is only needed for file sessions.
44 | |
45 | */
46 |
47 | 'files' => storage_path().'/sessions',
48 |
49 | /*
50 | |--------------------------------------------------------------------------
51 | | Session Database Connection
52 | |--------------------------------------------------------------------------
53 | |
54 | | When using the "database" or "redis" session drivers, you may specify a
55 | | connection that should be used to manage these sessions. This should
56 | | correspond to a connection in your database configuration options.
57 | |
58 | */
59 |
60 | 'connection' => null,
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Session Database Table
65 | |--------------------------------------------------------------------------
66 | |
67 | | When using the "database" session driver, you may specify the table we
68 | | should use to manage the sessions. Of course, a sensible default is
69 | | provided for you; however, you are free to change this as needed.
70 | |
71 | */
72 |
73 | 'table' => 'sessions',
74 |
75 | /*
76 | |--------------------------------------------------------------------------
77 | | Session Sweeping Lottery
78 | |--------------------------------------------------------------------------
79 | |
80 | | Some session drivers must manually sweep their storage location to get
81 | | rid of old sessions from storage. Here are the chances that it will
82 | | happen on a given request. By default, the odds are 2 out of 100.
83 | |
84 | */
85 |
86 | 'lottery' => array(2, 100),
87 |
88 | /*
89 | |--------------------------------------------------------------------------
90 | | Session Cookie Name
91 | |--------------------------------------------------------------------------
92 | |
93 | | Here you may change the name of the cookie used to identify a session
94 | | instance by ID. The name specified here will get used every time a
95 | | new session cookie is created by the framework for every driver.
96 | |
97 | */
98 |
99 | 'cookie' => 'laravel_session',
100 |
101 | /*
102 | |--------------------------------------------------------------------------
103 | | Session Cookie Path
104 | |--------------------------------------------------------------------------
105 | |
106 | | The session cookie path determines the path for which the cookie will
107 | | be regarded as available. Typically, this will be the root path of
108 | | your application but you are free to change this when necessary.
109 | |
110 | */
111 |
112 | 'path' => '/',
113 |
114 | /*
115 | |--------------------------------------------------------------------------
116 | | Session Cookie Domain
117 | |--------------------------------------------------------------------------
118 | |
119 | | Here you may change the domain of the cookie used to identify a session
120 | | in your application. This will determine which domains the cookie is
121 | | available to in your application. A sensible default has been set.
122 | |
123 | */
124 |
125 | 'domain' => null,
126 |
127 | /*
128 | |--------------------------------------------------------------------------
129 | | HTTPS Only Cookies
130 | |--------------------------------------------------------------------------
131 | |
132 | | By setting this option to true, session cookies will only be sent back
133 | | to the server if the browser has a HTTPS connection. This will keep
134 | | the cookie from being sent to you if it can not be done securely.
135 | |
136 | */
137 |
138 | 'secure' => false,
139 |
140 | );
141 |
--------------------------------------------------------------------------------
/app/config/testing/cache.php:
--------------------------------------------------------------------------------
1 | 'array',
19 |
20 | );
--------------------------------------------------------------------------------
/app/config/testing/session.php:
--------------------------------------------------------------------------------
1 | 'array',
20 |
21 | );
--------------------------------------------------------------------------------
/app/config/view.php:
--------------------------------------------------------------------------------
1 | array(__DIR__.'/../views'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Pagination View
21 | |--------------------------------------------------------------------------
22 | |
23 | | This view will be used to render the pagination link output, and can
24 | | be easily customized here to show any view you like. A clean view
25 | | compatible with Twitter's Bootstrap is given to you by default.
26 | |
27 | */
28 |
29 | 'pagination' => 'pagination::slider-3',
30 |
31 | );
32 |
--------------------------------------------------------------------------------
/app/config/workbench.php:
--------------------------------------------------------------------------------
1 | '',
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Workbench Author E-Mail Address
21 | |--------------------------------------------------------------------------
22 | |
23 | | Like the option above, your e-mail address is used when generating new
24 | | workbench packages. The e-mail is placed in your composer.json file
25 | | automatically after the package is created by the workbench tool.
26 | |
27 | */
28 |
29 | 'email' => '',
30 |
31 | );
--------------------------------------------------------------------------------
/app/controllers/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualAppeal/ping-laravel/270bf48d9b36fa6d802daf36383c884e1c9b6b1c/app/controllers/.gitkeep
--------------------------------------------------------------------------------
/app/controllers/ApiController.php:
--------------------------------------------------------------------------------
1 | select(array(
11 | DB::raw('UNIX_TIMESTAMP(`created_at`) * 1000 AS `x`'),
12 | DB::raw('`success` AS `y`'),
13 | ))
14 | ->where('check_id', '=', $check->id)
15 | ->where('created_at', '>', DB::raw('NOW() - INTERVAL 1 MONTH'))
16 | ->orderBy('created_at', 'asc')
17 | ->get();
18 |
19 | $data = array_map(function($result) {
20 | return array(
21 | 'x' => (int) $result->x,
22 | 'y' => (int) $result->y,
23 | 'color' => ($result->y == 0) ? '#D95C5C' : '#A1CF64',
24 | );
25 | }, $data);
26 |
27 | return array(array(
28 | 'name' => trans('check.uptime'),
29 | 'data' => $data,
30 | ));
31 | }
32 |
33 | public function checkLog($id)
34 | {
35 | $check = Check::findOrFail($id);
36 |
37 | return $check->getLog();
38 | }
39 |
40 | public function checkLatency($id)
41 | {
42 | $check = Check::findOrFail($id);
43 |
44 | $data = DB::table('checks_results')
45 | ->select(array(
46 | DB::raw('UNIX_TIMESTAMP(`created_at`) * 1000 AS `x`'),
47 | DB::raw('`latency` AS `y`'),
48 | ))
49 | ->where('check_id', '=', $check->id)
50 | ->where('created_at', '>', DB::raw('NOW() - INTERVAL 1 WEEK'))
51 | ->orderBy('created_at', 'asc')
52 | ->get();
53 |
54 | $data = array_map(function($result) use($check) {
55 | return array(
56 | 'x' => (int) $result->x,
57 | 'y' => (int) $result->y,
58 | 'color' => ($result->y / 1000 < $check->latency_tolerating) ? ($result->y / 1000 < $check->latency_satisfied) ? '#A1CF64' : '#F05940' : '#D95C5C'
59 | );
60 | }, $data);
61 |
62 | return array(array(
63 | 'name' => trans('check.latency'),
64 | 'data' => $data,
65 | ));
66 | }
67 | }
--------------------------------------------------------------------------------
/app/controllers/BaseController.php:
--------------------------------------------------------------------------------
1 | layout))
13 | {
14 | $this->layout = View::make($this->layout);
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/app/controllers/CheckController.php:
--------------------------------------------------------------------------------
1 | 'required|exists:companies,id',
7 | 'url' => 'required|url',
8 | 'port' => 'required|integer|max:65536',
9 | 'interval' => 'required|integer',
10 | 'latency_satisfied' => 'required|integer|max:30',
11 | 'latency_tolerating' => 'required|integer|max:30',
12 | );
13 |
14 | public function index()
15 | {
16 | $checks = Check::forUser(Sentry::getUser()->id)->with('theCompany')->get();
17 | $checks = $checks->filter(function($check) {
18 | if (isset($check->theUser->id) && isset($check->theCompany->id))
19 | return $check;
20 | else
21 | return null;
22 | });
23 |
24 | return View::make('check.index', array(
25 | 'checks' => $checks,
26 | ));
27 | }
28 |
29 | public function show($id)
30 | {
31 | $check = Check::findOrFail($id);
32 |
33 | return View::make('check.show', array(
34 | 'check' => $check,
35 | 'log' => $check->getLog(),
36 | ));
37 | }
38 |
39 | public function create()
40 | {
41 | return View::make('check.create', array(
42 | 'check' => new Check(array(
43 | 'port' => 80,
44 | 'interval' => 5,
45 | 'notify_failed_checks' => true,
46 | 'notify_back_online' => true,
47 | 'latency_satisfied' => 2,
48 | 'latency_tolerating' => 5,
49 | )),
50 | 'companies' => Company::forUser(Sentry::getUser()->id)->lists('name', 'id'),
51 | ));
52 | }
53 |
54 | public function store()
55 | {
56 | $input = Input::all();
57 |
58 | $validator = Validator::make($input, $this->rules);
59 | if ($validator->passes()) {
60 | $company = Company::forUser(Sentry::getUser()->id)->findOrFail($input['company_id']);
61 |
62 | $check = Check::create(array(
63 | 'company_id' => $company->id,
64 | 'user_id' => Sentry::getUser()->id,
65 | 'url' => $input['url'],
66 | 'port' => $input['port'],
67 | 'username' => !empty($input['username']) ? $input['username'] : null,
68 | 'password' => !empty($input['password']) ? $input['password'] : null,
69 | 'check_for' => !empty($input['check_for']) ? $input['check_for'] : null,
70 | 'interval' => $input['interval'],
71 | 'notify_failed_checks' => isset($input['notify_failed_checks']) ? true : false,
72 | 'notify_back_online' => isset($input['notify_back_online']) ? true : false,
73 | 'latency_satisfied' => $input['latency_satisfied'],
74 | 'latency_tolerating' => $input['latency_tolerating'],
75 | ));
76 |
77 | Session::flash('success', trans('check.create.success', array('url' => $check->url)));
78 | return Redirect::route('check.show', array('id' => $check->id));
79 | }
80 |
81 | return Redirect::back()->withErrors($validator)->withInput($input);
82 | }
83 |
84 | public function edit($id)
85 | {
86 | $check = Check::findOrFail($id);
87 |
88 | return View::make('check.edit', array(
89 | 'check' => $check,
90 | 'companies' => Company::forUser(Sentry::getUser()->id)->lists('name', 'id'),
91 | ));
92 | }
93 |
94 | public function update($id)
95 | {
96 | $check = Check::findOrFail($id);
97 | $input = Input::all();
98 |
99 | $validator = Validator::make($input, $this->rules);
100 | if ($validator->passes()) {
101 | $check->company_id = $input['company_id'];
102 | $check->url = $input['url'];
103 | $check->port = $input['port'];
104 | $check->username = !empty($input['username']) ? $input['username'] : null;
105 | $check->password = !empty($input['password']) ? $input['password'] : null;
106 | $check->check_for = !empty($input['check_for']) ? $input['check_for'] : null;
107 | $check->interval = $input['interval'];
108 | $check->notify_failed_checks = isset($input['notify_failed_checks']) ? true : false;
109 | $check->notify_back_online = isset($input['notify_back_online']) ? true : false;
110 | $check->latency_satisfied = $input['latency_satisfied'];
111 | $check->latency_tolerating = $input['latency_tolerating'];
112 | $check->save();
113 |
114 | Session::flash('success', trans('check.edit.success', array('url' => $check->url)));
115 | return Redirect::route('check.show', array('id' => $check->id));
116 | }
117 |
118 | return Redirect::back()->withErrors($validator)->withInput($input);
119 | }
120 |
121 | public function delete($id)
122 | {
123 | $check = Check::findOrFail($id);
124 | $check->delete();
125 |
126 | Session::flash('info', trans('check.delete.success', array(
127 | 'url' => $check->url,
128 | 'restoreUrl' => URL::route('check.restore', array('id' => $check->id))
129 | )));
130 | return Redirect::route('check.index');
131 | }
132 |
133 | public function restore($id)
134 | {
135 | $check = Check::onlyTrashed()->find($id);
136 | $check->restore();
137 |
138 | return Redirect::route('check.show', array('id' => $check->id));
139 | }
140 |
141 | public function pause($id)
142 | {
143 | $check = Check::findOrFail($id);
144 | $check->paused = true;
145 | $check->save();
146 |
147 | Session::flash('success', trans('check.pause.success'));
148 | return Redirect::route('check.index');
149 | }
150 |
151 | public function unpause($id)
152 | {
153 | $check = Check::findOrFail($id);
154 | $check->paused = false;
155 | $check->save();
156 |
157 | Session::flash('success', trans('check.unpause.success'));
158 | return Redirect::route('check.index');
159 | }
160 | }
--------------------------------------------------------------------------------
/app/controllers/CompanyController.php:
--------------------------------------------------------------------------------
1 | 'required',
7 | );
8 |
9 | public function index()
10 | {
11 | $companies = Company::forUser(Sentry::getUser()->id)->get();
12 |
13 | return View::make('company.index', array(
14 | 'companies' => $companies,
15 | ));
16 | }
17 |
18 | public function addUser($id)
19 | {
20 | $company = Company::findOrFail($id);
21 | $user = User::where('email', '=', Input::get('invite_user_email'))
22 | ->first();
23 |
24 | if ($user === null) {
25 | Session::flash('error', trans('company.user.add.user-not-found'));
26 | return Redirect::route('company.index');
27 | }
28 |
29 | $userCompany = UserCompany::where('user_id', '=', $user->id)
30 | ->where('company_id', '=', $company->id)
31 | ->first();
32 |
33 | if ($userCompany !== null) {
34 | Session::flash('error', trans('company.user.add.user-already-added'));
35 | return Redirect::route('company.index');
36 | }
37 |
38 | $userCompany = UserCompany::create(array(
39 | 'user_id' => $user->id,
40 | 'company_id' => $company->id,
41 | ));
42 |
43 | Session::flash('success', trans('company.user.add.success'));
44 | return Redirect::route('company.index');
45 | }
46 |
47 | public function removeUser($id, $userId)
48 | {
49 | $company = Company::findOrFail($id);
50 | $user = User::findOrFail($userId);
51 |
52 | if ($company->user_id == $user->id) {
53 | Session::flash('error', trans('company.user.remove.not-creator'));
54 | return Redirect::route('company.index');
55 | }
56 |
57 | $userCompany = UserCompany::where('user_id', '=', $user->id)
58 | ->where('company_id', '=', $company->id)
59 | ->first();
60 |
61 | if ($userCompany === null) {
62 | Session::flash('error', trans('company.user.remove.not-found'));
63 | return Redirect::route('company.index');
64 | }
65 |
66 | $userCompany = UserCompany::where('user_id', '=', $user->id)
67 | ->where('company_id', '=', $company->id)
68 | ->delete();
69 |
70 | Session::flash('info', trans('company.user.remove.success'));
71 | return Redirect::route('company.index');
72 | }
73 |
74 | public function show($id)
75 | {
76 | $company = Company::findOrFail($id);
77 |
78 | return View::make('company.show', array(
79 | 'company' => $company,
80 | ));
81 | }
82 |
83 | public function create()
84 | {
85 | return View::make('company.create');
86 | }
87 |
88 | public function store()
89 | {
90 | $input = Input::all();
91 |
92 | $validator = Validator::make($input, $this->rules);
93 | if ($validator->passes()) {
94 | $company = Company::create(array(
95 | 'user_id' => Sentry::getUser()->id,
96 | 'name' => $input['name'],
97 | ));
98 |
99 | UserCompany::create(array(
100 | 'company_id' => $company->id,
101 | 'user_id' => $company->user_id,
102 | ));
103 |
104 | Session::flash('success', trans('company.create.success', array('name' => $company->name)));
105 | return Redirect::route('company.show', array('id' => $company->id));
106 | }
107 |
108 | return Redirect::back()->withErrors($validator)->withInput($input);
109 | }
110 |
111 | public function edit($id)
112 | {
113 | $company = Company::findOrFail($id);
114 |
115 | return View::make('company.edit', array(
116 | 'company' => $company,
117 | ));
118 | }
119 |
120 | public function update($id)
121 | {
122 | $company = Company::findOrFail($id);
123 | $input = Input::all();
124 |
125 | $validator = Validator::make($input, $this->rules);
126 | if ($validator->passes()) {
127 | $company->name = $input['name'];
128 | $company->save();
129 |
130 | Session::flash('success', trans('company.edit.success', array('name' => $company->name)));
131 | return Redirect::route('company.show', array('id' => $company->id));
132 | }
133 |
134 | return Redirect::back()->withErrors($validator)->withInput($input);
135 | }
136 |
137 | public function delete($id)
138 | {
139 | $company = Company::findOrFail($id);
140 | $company->delete();
141 |
142 | Session::flash('info', trans('company.delete.success', array(
143 | 'name' => $company->name,
144 | 'restoreUrl' => URL::route('company.restore', array('id' => $company->id))
145 | )));
146 | return Redirect::route('company.index');
147 | }
148 |
149 | public function restore($id)
150 | {
151 | $company = Company::onlyTrashed()->find($id);
152 | $company->restore();
153 |
154 | return Redirect::route('company.show', array('id' => $company->id));
155 | }
156 | }
--------------------------------------------------------------------------------
/app/controllers/HomeController.php:
--------------------------------------------------------------------------------
1 | 'required|email',
7 | );
8 |
9 | protected $registerRules = array(
10 | 'email' => 'required|email|unique:users',
11 | 'password' => 'required|min:6',
12 | 'password_repeat' => 'same:password',
13 | );
14 |
15 | public function login()
16 | {
17 | return View::make('user.login');
18 | }
19 |
20 | public function doLogin()
21 | {
22 | try {
23 | $user = Sentry::findUserByCredentials(array(
24 | 'email' => isset($_POST['email']) ? $_POST['email'] : '',
25 | 'password' => isset($_POST['password']) ? $_POST['password'] : '',
26 | ));
27 |
28 | $remember = isset($_POST['remember']) ? true : false;
29 |
30 | Sentry::login($user, $remember);
31 |
32 | if (Session::get('redirectUri', false) !== false)
33 | return Redirect::to(Session::get('redirectUri'));
34 | else
35 | return Redirect::route('check.index');
36 | } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
37 | Session::flash('error', trans('user.login.no-email'));
38 | } catch (Cartalyst\Sentry\Users\UserNotActivatedException $e) {
39 | Session::flash('error', trans('user.login.not-activated'));
40 | } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
41 | Session::flash('error', trans('user.login.unknown'));
42 | } catch (Cartalyst\Sentry\Throttling\UserSuspendedException $e) {
43 | Session::flash('error', trans('user.login.suspended', $throttle->getSuspensionTime()));
44 | } catch (Cartalyst\Sentry\Throttling\UserBannedException $e) {
45 | Session::flash('error', trans('user.login.banned'));
46 | }
47 |
48 | return Redirect::back()->withInput();
49 | }
50 |
51 | public function loginGithub()
52 | {
53 | $code = Input::get('code');
54 | $email = Input::get('email');
55 | $github = OAuth::consumer('GitHub');
56 |
57 | if (!empty($email)) {
58 | $user = User::where('email', '=', $email)->first();
59 |
60 | if (isset($user)) {
61 | Session::flash('warning', trans('user.register.social.already-exists'));
62 | return Redirect::route('user.register');
63 | }
64 |
65 | $user = Sentry::createUser(array(
66 | 'email' => $email,
67 | 'password' => md5(time() . uniqid()),
68 | 'activated' => true,
69 | ));
70 |
71 | UserGitHub::create(array(
72 | 'user_id' => $user->id,
73 | 'access_token' => Input::get('access_token'),
74 | 'refresh_token' => !empty(Input::get('refresh_token')) ? Input::get('refresh_token') : null,
75 | 'end_of_life' => !empty(Input::get('end_of_life')) ? Input::get('end_of_life') : null,
76 | ));
77 |
78 | $user = Sentry::findUserByLogin($user->email);
79 | Sentry::login($user, false);
80 |
81 | Session::flash('success', trans('user.register.social.success'));
82 | return Redirect::route('home');
83 | } elseif (empty($code)) {
84 | $url = $github->getAuthorizationUri(array(
85 | 'state' => md5(time() . uniqid()),
86 | 'redirect_uri' => URL::route('user.login.github'),
87 | ));
88 |
89 | return Response::make()->header('Location', (string) $url);
90 | } else {
91 | $token = $github->requestAccessToken($code);
92 | $emails = json_decode($github->request('/user/emails'), true);
93 |
94 | if (!is_array($emails) || count($emails) === 0) {
95 | Session::flash('error', trans('user.register.social.no-emails'));
96 | return Redirect::route('user.register');
97 | }
98 |
99 | if (count($emails) <= 1) {
100 | $user = User::where('email', '=', $emails[0])->first();
101 |
102 | if (isset($user)) {
103 | Session::flash('warning', trans('user.register.social.already-exists'));
104 | return Redirect::route('user.register');
105 | }
106 |
107 | $user = Sentry::createUser(array(
108 | 'email' => $emails[0],
109 | 'password' => md5(time() . uniqid()),
110 | 'activated' => true,
111 | ));
112 |
113 | UserGitHub::create(array(
114 | 'user_id' => $user->id,
115 | 'access_token' => $token->getAccessToken(),
116 | 'refresh_token' => !empty($token->getRefreshToken()) ? $token->getRefreshToken() : null,
117 | 'end_of_life' => !empty($token->getEndOfLife()) ? $token->getEndOfLife() : null,
118 | ));
119 |
120 | Sentry::login($user, false);
121 |
122 | Session::flash('success', trans('user.register.social.success'));
123 | return Redirect::route('home');
124 | }
125 |
126 | return View::make('user.social', array(
127 | 'emails' => $emails,
128 | 'token' => $token,
129 | ));
130 | }
131 | }
132 |
133 | public function register()
134 | {
135 | return View::make('user.register');
136 | }
137 |
138 | public function doRegister()
139 | {
140 | $input = Input::all();
141 |
142 | $validator = Validator::make($input, $this->registerRules);
143 | if ($validator->passes()) {
144 | try {
145 | $user = Sentry::register(array(
146 | 'email' => $input['email'],
147 | 'password' => $input['password'],
148 | ));
149 |
150 | Mail::queue('email.activate', array(
151 | 'activationUrl' => URL::route('user.activate', array(
152 | 'code' => $user->getActivationCode()
153 | )),
154 | ),
155 | function($message) use($user) {
156 | $message->to($user->email)
157 | ->subject(trans('user.activate.email.subject'));
158 | }
159 | );
160 |
161 | Session::flash('success', trans('user.register.activation'));
162 | return Redirect::route('home');
163 | } catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {
164 | Session::flash('error', trans('user.register.email-required'));
165 | } catch (Cartalyst\Sentry\Users\PasswordRequiredException $e) {
166 | Session::flash('error', trans('user.register.password-required'));
167 | } catch (Cartalyst\Sentry\Users\UserExistsException $e) {
168 | Session::flash('error', trans('user.register.email-unique'));
169 | return Redirect::route('user.login');
170 | }
171 |
172 | return Redirect::back()->withInput();
173 | }
174 |
175 | return Redirect::back()->withErrors($validator)->withInput($input);
176 | }
177 |
178 | public function activate($code)
179 | {
180 | try {
181 | $user = Sentry::findUserByActivationCode($code);
182 |
183 | try {
184 | if ($user->attemptActivation($code))
185 | Session::flash('success', trans('user.activate.success'));
186 | else
187 | Session::flash('error', trans('user.activate.error'));
188 | } catch (Cartalyst\Sentry\Users\UserAlreadyActivatedException $e) {
189 | Session::flash('warning', trans('user.activate.already-activated'));
190 | }
191 | } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
192 | Session::flash('error', trans('user.activate.not-found'));
193 | return Redirect::route('user.register');
194 | }
195 |
196 | return Redirect::route('home');
197 | }
198 |
199 | public function account()
200 | {
201 | return View::make('user.account', array(
202 | 'user' => Sentry::getUser(),
203 | ));
204 | }
205 |
206 | public function save()
207 | {
208 | $input = Input::all();
209 |
210 | $validator = Validator::make($input, $this->accountRules);
211 | if ($validator->passes()) {
212 | $user = Sentry::getUser();
213 | if (!$user->checkPassword($input['old-password'])) {
214 | Session::flash('error', trans('user.save.wrong-password'));
215 | return Redirect::route('user.account');
216 | }
217 |
218 | try {
219 | $user->email = $input['email'];
220 | $user->first_name = $input['first_name'];
221 | $user->last_name = $input['last_name'];
222 | $user->save();
223 |
224 | Session::flash('success', trans('user.save.success'));
225 | }
226 | catch (Cartalyst\Sentry\Users\UserExistsException $e) {
227 | Session::flash('error', trans('user.save.already-exists'));
228 | }
229 |
230 | return Redirect::route('user.account');
231 | }
232 |
233 | return Redirect::back()->withErrors($validator)->withInput($input);
234 | }
235 |
236 | public function logout()
237 | {
238 | Sentry::logout();
239 | return Redirect::route('home');
240 | }
241 | }
--------------------------------------------------------------------------------
/app/database/migrations/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualAppeal/ping-laravel/270bf48d9b36fa6d802daf36383c884e1c9b6b1c/app/database/migrations/.gitkeep
--------------------------------------------------------------------------------
/app/database/migrations/2013_03_02_222737_migration_cartalyst_sentry_install_users.php:
--------------------------------------------------------------------------------
1 | increments('id');
35 | $table->string('email');
36 | $table->string('password');
37 | $table->text('permissions')->nullable();
38 | $table->boolean('activated')->default(0);
39 | $table->string('activation_code')->nullable();
40 | $table->timestamp('activated_at')->nullable();
41 | $table->timestamp('last_login')->nullable();
42 | $table->string('persist_code')->nullable();
43 | $table->string('reset_password_code')->nullable();
44 | $table->string('first_name')->nullable();
45 | $table->string('last_name')->nullable();
46 | $table->timestamps();
47 |
48 | // We'll need to ensure that MySQL uses the InnoDB engine to
49 | // support the indexes, other engines aren't affected.
50 | $table->engine = 'InnoDB';
51 | $table->unique('email');
52 | $table->index('activation_code');
53 | $table->index('reset_password_code');
54 | });
55 | }
56 |
57 | /**
58 | * Reverse the migrations.
59 | *
60 | * @return void
61 | */
62 | public function down()
63 | {
64 | Schema::drop('users');
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_03_02_222738_migration_cartalyst_sentry_install_groups.php:
--------------------------------------------------------------------------------
1 | increments('id');
35 | $table->string('name');
36 | $table->text('permissions')->nullable();
37 | $table->timestamps();
38 |
39 | // We'll need to ensure that MySQL uses the InnoDB engine to
40 | // support the indexes, other engines aren't affected.
41 | $table->engine = 'InnoDB';
42 | $table->unique('name');
43 | });
44 | }
45 |
46 | /**
47 | * Reverse the migrations.
48 | *
49 | * @return void
50 | */
51 | public function down()
52 | {
53 | Schema::drop('groups');
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_03_02_222739_migration_cartalyst_sentry_install_users_groups_pivot.php:
--------------------------------------------------------------------------------
1 | integer('user_id')->unsigned();
35 | $table->integer('group_id')->unsigned();
36 |
37 | // We'll need to ensure that MySQL uses the InnoDB engine to
38 | // support the indexes, other engines aren't affected.
39 | $table->engine = 'InnoDB';
40 | $table->primary(array('user_id', 'group_id'));
41 | });
42 | }
43 |
44 | /**
45 | * Reverse the migrations.
46 | *
47 | * @return void
48 | */
49 | public function down()
50 | {
51 | Schema::drop('users_groups');
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_03_02_222740_migration_cartalyst_sentry_install_throttle.php:
--------------------------------------------------------------------------------
1 | increments('id');
35 | $table->integer('user_id')->unsigned()->nullable();
36 | $table->string('ip_address')->nullable();
37 | $table->integer('attempts')->default(0);
38 | $table->boolean('suspended')->default(0);
39 | $table->boolean('banned')->default(0);
40 | $table->timestamp('last_attempt_at')->nullable();
41 | $table->timestamp('suspended_at')->nullable();
42 | $table->timestamp('banned_at')->nullable();
43 |
44 | // We'll need to ensure that MySQL uses the InnoDB engine to
45 | // support the indexes, other engines aren't affected.
46 | $table->engine = 'InnoDB';
47 | $table->index('user_id');
48 | });
49 | }
50 |
51 | /**
52 | * Reverse the migrations.
53 | *
54 | * @return void
55 | */
56 | public function down()
57 | {
58 | Schema::drop('throttle');
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/app/database/migrations/2013_12_22_184132_init.php:
--------------------------------------------------------------------------------
1 | increments('id');
16 | $table->integer('user_id')->unsigned();
17 | $table->string('name', 100);
18 |
19 | $table->timestamps();
20 | $table->softDeletes();
21 |
22 | $table->foreign('user_id')->references('id')->on('users');
23 | });
24 |
25 | Schema::create('users_companies', function($table) {
26 | $table->integer('user_id')->unsigned();
27 | $table->integer('company_id')->unsigned();
28 |
29 | $table->index('user_id');
30 | $table->index('company_id');
31 | });
32 |
33 | Schema::create('checks', function($table) {
34 | $table->increments('id');
35 | $table->integer('company_id')->unsigned();
36 | $table->integer('user_id')->unsigned();
37 | $table->string('url', 255);
38 | $table->integer('port')->default(80);
39 | $table->string('username', 255)->nullable();
40 | $table->string('password', 255)->nullable();
41 | $table->string('check_for', 255)->nullable();
42 | $table->integer('interval')->unsigned()->default(5);
43 | $table->integer('notify_failed_checks')->unsigned()->default(1);
44 | $table->boolean('notify_back_online')->default(true);
45 | $table->integer('latency_satisfied')->unsigned()->default(4);
46 | $table->integer('latency_tolerating')->unsigned()->default(16);
47 | $table->boolean('paused')->default(false);
48 |
49 | $table->timestamps();
50 | $table->softDeletes();
51 |
52 | $table->index('company_id');
53 | $table->index('user_id');
54 | });
55 |
56 | Schema::create('checks_results', function($table) {
57 | $table->bigIncrements('id');
58 | $table->integer('check_id')->unsigned();
59 | $table->smallInteger('status_code')->unsigned();
60 | $table->smallInteger('latency');
61 | $table->text('content')->nullable();
62 | $table->text('headers')->nullable();
63 | $table->boolean('success');
64 |
65 | $table->timestamps();
66 |
67 | $table->index('check_id');
68 | });
69 | }
70 |
71 | /**
72 | * Reverse the migrations.
73 | *
74 | * @return void
75 | */
76 | public function down()
77 | {
78 | Schema::dropIfExists('checks_results');
79 | Schema::dropIfExists('checks');
80 | Schema::dropIfExists('users_companies');
81 | Schema::dropIfExists('companies');
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/app/database/migrations/2014_01_23_145524_oauth_login.php:
--------------------------------------------------------------------------------
1 | increments('id');
16 | $table->integer('user_id')->unsigned();
17 | $table->string('access_token', 255);
18 | $table->string('refresh_token', 255)->nullable();
19 | $table->timestamp('end_of_life')->nullable();
20 |
21 | $table->timestamps();
22 |
23 | $table->foreign('user_id')->references('id')->on('users');
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('users_social_github');
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/app/database/migrations/2015_01_06_115830_create_failed_jobs_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->text('connection');
19 | $table->text('queue');
20 | $table->text('payload');
21 | $table->timestamp('failed_at');
22 | });
23 | }
24 |
25 | /**
26 | * Reverse the migrations.
27 | *
28 | * @return void
29 | */
30 | public function down()
31 | {
32 | Schema::drop('failed_jobs');
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/app/database/production.sqlite:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualAppeal/ping-laravel/270bf48d9b36fa6d802daf36383c884e1c9b6b1c/app/database/production.sqlite
--------------------------------------------------------------------------------
/app/database/seeds/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualAppeal/ping-laravel/270bf48d9b36fa6d802daf36383c884e1c9b6b1c/app/database/seeds/.gitkeep
--------------------------------------------------------------------------------
/app/database/seeds/CheckSeeder.php:
--------------------------------------------------------------------------------
1 | delete();
13 |
14 | $check = Check::create(array(
15 | 'url' => 'http://www.example.com',
16 | 'user_id' => 1,
17 | 'company_id' => 1,
18 | 'port' => 80,
19 | 'interval' => 5,
20 | ));
21 |
22 | $start = \Carbon\Carbon::now()->subDays(3);
23 | $now = \Carbon\Carbon::now();
24 |
25 | while ($start->diffInSeconds($now, false) > 0) {
26 | $success = (rand(0, 100) != 0);
27 | CheckResult::create(array(
28 | 'check_id' => $check->id,
29 | 'status_code' => $success ? 200 : 500,
30 | 'latency' => $success ? rand(100, 4000) : rand(10000, 60000),
31 | 'success' => $success,
32 | 'created_at' => $start,
33 | ));
34 | $start->addMinutes(5);
35 | }
36 |
37 | $check = Check::create(array(
38 | 'url' => 'http://www.example.org',
39 | 'user_id' => 2,
40 | 'company_id' => 2,
41 | 'port' => 8080,
42 | 'interval' => 15,
43 | ));
44 |
45 | $start = \Carbon\Carbon::now()->subDays(1);
46 | $now = \Carbon\Carbon::now();
47 |
48 | while ($start->diffInSeconds($now, false) > 0) {
49 | $success = (rand(0, 100) != 0);
50 | CheckResult::create(array(
51 | 'check_id' => $check->id,
52 | 'status_code' => $success ? 200 : 500,
53 | 'latency' => $success ? rand(100, 4000) : rand(10000, 60000),
54 | 'success' => $success,
55 | 'created_at' => $start,
56 | ));
57 | $start->addMinutes(15);
58 | }
59 | }
60 | }
--------------------------------------------------------------------------------
/app/database/seeds/CompanySeeder.php:
--------------------------------------------------------------------------------
1 | delete();
13 | DB::table('users_companies')->delete();
14 |
15 | $visible = Company::create(array(
16 | 'name' => 'Visible',
17 | 'user_id' => 1,
18 | ));
19 |
20 | $invisible = Company::create(array(
21 | 'name' => 'Invisible',
22 | 'user_id' => 1,
23 | ));
24 |
25 | UserCompany::create(array(
26 | 'company_id' => $visible->id,
27 | 'user_id' => 1,
28 | ));
29 |
30 | UserCompany::create(array(
31 | 'company_id' => $invisible->id,
32 | 'user_id' => 2,
33 | ));
34 | }
35 | }
--------------------------------------------------------------------------------
/app/database/seeds/DevelopmentSeeder.php:
--------------------------------------------------------------------------------
1 | call('UserSeeder');
15 |
16 | Sentry::register(array(
17 | 'email' => 'test@example.org',
18 | 'password' => 123456,
19 | ), true);
20 |
21 | $this->call('CompanySeeder');
22 | $this->call('CheckSeeder');
23 | }
24 | }
--------------------------------------------------------------------------------
/app/database/seeds/InstallSeeder.php:
--------------------------------------------------------------------------------
1 | call('UserSeeder');
15 | }
16 | }
--------------------------------------------------------------------------------
/app/database/seeds/UserSeeder.php:
--------------------------------------------------------------------------------
1 | delete();
13 | DB::table('users')->delete();
14 | DB::table('groups')->delete();
15 |
16 | $defaultUser = Config::get('auth.default');
17 |
18 | if (is_array($defaultUser)) {
19 | $user = Sentry::register($defaultUser, true);
20 | echo "User {$defaultUser['email']} created with password {$defaultUser['password']}\n";
21 |
22 | $adminGroup = Sentry::createGroup(array(
23 | 'name' => 'admin',
24 | 'permissions' => array(
25 | 'admin' => 1,
26 | ),
27 | ));
28 |
29 | $user->addGroup($adminGroup);
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/app/filters.php:
--------------------------------------------------------------------------------
1 | false, // Do not verify certificate
11 | );
12 |
13 | if (!empty($check->username)) {
14 | $options['auth'] = array($check->username, $check->password);
15 | }
16 |
17 | try {
18 | $latencyStart = microtime(true);
19 | $response = Requests::get($check->url, $headers, $options);
20 | $latency = round((microtime(true) - $latencyStart) * 1000);
21 | } catch (Requests_Exception $e) {
22 | $latency = round((microtime(true) - $latencyStart) * 1000);
23 | if (CheckResult::create(array(
24 | 'check_id' => $check->id,
25 | 'status_code' => 0,
26 | 'success' => false,
27 | 'latency' => $latency,
28 | 'content' => trans('check.errors.resolve-host', array('host' => $check->url)),
29 | ))) {
30 | $job->delete();
31 | } else {
32 | $job->release();
33 | }
34 |
35 | return true;
36 | }
37 |
38 | $lastCheck = CheckResult::where('check_id', '=', $check->id)
39 | ->orderBy('created_at', 'desc')
40 | ->first();
41 |
42 | if ($response->success) {
43 | if (isset($lastCheck) && !$lastCheck->success) {
44 | Mail::queue('email.check.online', array(
45 | 'id' => $check->id,
46 | 'title' => $check->title,
47 | ),
48 | function($message) use($check) {
49 | $message->to($check->theUser->email)
50 | ->subject(trans('check.job.email.online.subject', array('title' => $check->title)));
51 | });
52 | }
53 |
54 | if (CheckResult::create(array(
55 | 'check_id' => $check->id,
56 | 'status_code' => $response->status_code,
57 | 'success' => true,
58 | 'latency' => $latency,
59 | ))) {
60 | $job->delete();
61 | } else {
62 | $job->release();
63 | }
64 | } else {
65 | if (isset($lastCheck) && $lastCheck->success) {
66 | Mail::queue('email.check.offline', array(
67 | 'id' => $check->id,
68 | 'title' => $check->title,
69 | 'statusCode' => $response->status_code
70 | ),
71 | function($message) use($check) {
72 | $message->to($check->theUser->email)
73 | ->subject(trans('check.job.email.offline.subject', array('title' => $check->title)));
74 | });
75 | }
76 |
77 | if (CheckResult::create(array(
78 | 'check_id' => $check->id,
79 | 'status_code' => $response->status_code,
80 | 'success' => false,
81 | 'content' => $response->body,
82 | 'headers' => json_encode($response->headers),
83 | 'latency' => $latency,
84 | ))) {
85 | $job->delete();
86 | } else {
87 | $job->release();
88 | }
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/app/lang/de/base.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'login' => 'Anmelden',
6 | 'register' => 'Registrieren',
7 | 'companies' => 'Unternehmen',
8 | 'checks' => 'Checks',
9 | 'account' => 'Konto',
10 | 'logout' => 'Abmelden',
11 | ),
12 | );
13 |
--------------------------------------------------------------------------------
/app/lang/de/check.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'days' => 'Tag|Tage',
6 | 'hours' => 'Stunde|Stunden',
7 | 'minutes' => 'Minute|Minuten',
8 | ),
9 |
10 | 'index' => array(
11 | 'title' => 'Checks',
12 | 'headline' => 'Checks',
13 | 'empty' => 'Du hast noch keine Checks erstellt. Möchtest du jetzt einen Check erstellen ?',
14 | 'create' => 'Check erstellen',
15 | '24h' => 'Letzte 24h',
16 | 'url' => 'URL',
17 | 'user' => 'Benutzer',
18 | 'company' => 'Unternehmen',
19 | 'interval' => 'Intervall',
20 | 'show' => 'Anzeigen',
21 | 'edit' => 'Bearbeiten',
22 | 'delete' => 'Löschen',
23 | 'pause' => 'Pausieren',
24 | 'unpause' => 'Wieder prüfen',
25 | ),
26 |
27 | 'show' => array(
28 | 'title' => 'Check :title',
29 | 'headline' => ':title',
30 | 'uptime' => 'Verfügbarkeit',
31 | 'success' => 'Verfügbar',
32 | 'begin' => 'Beginn',
33 | 'end' => 'Ende',
34 | 'duration' => 'Dauer',
35 | 'latency' => 'Latenz',
36 | 'delete' => 'Check löschen',
37 | ),
38 |
39 | 'create' => array(
40 | 'title' => 'Check erstellen',
41 | 'headline' => 'Neuer Check',
42 | 'submit' => 'Check erstellen',
43 | 'success' => 'Der Check wurde erfolgreich erstellt.',
44 | ),
45 |
46 | 'form' => array(
47 | 'company_id' => 'Unternehmen',
48 | 'url' => 'URL',
49 | 'url-placeholder' => 'http://www.google.de',
50 | 'port' => 'Port',
51 | 'username' => 'Benutzername (HTTP-Auth)',
52 | 'password' => 'Passwort (HTTP-Auth)',
53 | 'check_for' => 'Suche in Quelltext',
54 | 'interval' => 'Intervall (in Minuten)',
55 | 'notify_failed_checks' => 'Benachrichtigung bei fehlgeschlagenen Checks',
56 | 'notify_back_online' => 'Benachrichtigung wenn Webseite wieder erreichbar',
57 | 'latency_satisfied' => 'Latenz - Zufriedenstellend (in Sekunden)',
58 | 'latency_tolerating' => 'Latenz - Toleriert (in Sekunden)',
59 | ),
60 |
61 | 'edit' => array(
62 | 'title' => 'Check bearbeiten',
63 | 'headline' => ':url bearbeiten',
64 | 'submit' => 'Check bearbeiten',
65 | 'success' => 'Der Check wurde erfolgreich bearbeitet.',
66 | ),
67 |
68 | 'delete' => array(
69 | 'success' => 'Der Check :url wurde erfolgreich gelöscht! Du kannst den Check aber wiederherstellen .'
70 | ),
71 |
72 | 'errors' => array(
73 | 'resolve-host' => 'Der Host :host konnte nicht aufgelöst werden',
74 | ),
75 |
76 | 'job' => array(
77 | 'email' => array(
78 | 'online' => array(
79 | 'subject' => '[ping] :title ist wieder online!',
80 | 'title' => ':title ist online',
81 | 'headline' => ':title ist online',
82 | 'content' => ':title ist wieder erreichbar.',
83 | ),
84 |
85 | 'offline' => array(
86 | 'subject' => '[ping] :title ist offline!',
87 | 'title' => ':title ist offline',
88 | 'headline' => ':title ist offline',
89 | 'content' => ':title ist aufgrund eines Fehlers :code nicht erreichbar!',
90 | ),
91 | ),
92 | ),
93 |
94 | 'pause' => array(
95 | 'success' => 'Der Check wurde erfolgerich pausiert.',
96 | ),
97 |
98 | 'unpause' => array(
99 | 'success' => 'Der Check wird wieder ausgeführt.',
100 | ),
101 | );
--------------------------------------------------------------------------------
/app/lang/de/company.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'title' => 'Unternehmen',
6 | 'headline' => 'Unternehmen',
7 | 'create' => 'Neues Unternehmen erstellen',
8 | 'name' => 'Name',
9 | 'users' => 'Benutzer',
10 | 'show' => 'Anzeigen',
11 | 'edit' => 'Bearbeiten',
12 | 'delete' => 'Löschen',
13 | 'add-user' => 'Benutzer hinzufügen',
14 | 'empty' => 'Du hast noch kein Unternehmen erstellt. Möchtest du jetzt eins erstellen ?',
15 | ),
16 |
17 | 'user' => array(
18 | 'add' => array(
19 | 'title' => 'Füge einen Benutzer hinzu',
20 | 'description' => 'Füge einen Benutzer über seine E-Mail Adresse zu dem Unternehmen hinzu. Zur Zeit ist es nur möglich bereits registrierte Benutzer hinzuzufügen.',
21 | 'user' => 'E-Mail Adresse',
22 | 'close' => 'Abbrechen',
23 | 'invite' => 'Hinzufügen',
24 | 'success' => 'Der Benutzer wurde zu dem Unternehmen hinzugefügt.',
25 | 'user-not-found' => 'Ein Benutzer mit dieser E-Mail Adresse existiert noch nicht!',
26 | 'user-already-added' => 'Der Benutzer hat bereits Zugriff auf das Unternehmen!',
27 | ),
28 |
29 | 'remove' => array(
30 | 'not-found' => 'Der Benutzer konnte nicht gefunden werden!',
31 | 'not-creator' => 'Der Ersteller des Unternehmens kann nicht gelöscht werden!',
32 | 'success' => 'Der Benutzer wurde aus dem Unternehmen entfernt.',
33 | ),
34 | ),
35 |
36 | 'show' => array(
37 | 'title' => ':name',
38 | 'headline' => ':name',
39 | 'delete' => 'Unternehmen löschen',
40 | ),
41 |
42 | 'create' => array(
43 | 'title' => 'Neues Unternehmen erstellen',
44 | 'headline' => 'Neues Unternehmen',
45 | 'submit' => 'Unternehmen erstellen',
46 | 'success' => 'Das Unternehmen wurde erfolgreich erstellt.',
47 | ),
48 |
49 | 'edit' => array(
50 | 'title' => ':name bearbeiten',
51 | 'headline' => ':name bearbeiten',
52 | 'submit' => 'Unternehmen bearbeiten',
53 | 'success' => 'Die Änderungen wurden erfolgreich gespeichert.'
54 | ),
55 |
56 | 'delete' => array(
57 | 'success' => ':name wurde erfolgreich gelöscht! Du kannst es aber jetzt noch wiederherstellen .'
58 | ),
59 |
60 | 'form' => array(
61 | 'name' => 'Name',
62 | ),
63 | );
--------------------------------------------------------------------------------
/app/lang/de/dashboard.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'title' => 'Dashboard',
6 | 'headline' => 'Dashboard',
7 | ),
8 | );
--------------------------------------------------------------------------------
/app/lang/de/home.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'title' => 'Ping - Webseiten Status Monitor',
6 | 'headline' => 'Ping - Webseiten Status Monitor',
7 | 'intro' => 'Ping überwacht Server und Internetseiten auf ihre Erreichbarkeit. Sie können per E-Mail informiert werden falls einer ihrer Server oder Internetseiten nicht mehr erreichbar ist.',
8 | 'register' => 'Jetzt Registrieren',
9 | 'checks' => 'Zu ihren Checks',
10 | ),
11 | );
--------------------------------------------------------------------------------
/app/lang/de/user.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'title' => 'Anmelden',
6 | 'headline' => 'Anmelden',
7 |
8 | 'no-email' => 'Keine E-Mail Adresse angegeben!',
9 | 'not-activated' => 'Konto noch nicht aktiviert!',
10 | 'unknown' => 'Die E-Mail Adresse oder das Passwort ist falsch!',
11 | 'suspended' => 'Das Konto wurde deaktiviert!',
12 | 'banned' => 'Das Konto wurde gesperrt!',
13 |
14 | 'form' => array(
15 | 'email' => 'E-Mail Adresse',
16 | 'password' => 'Passwort',
17 | 'remember' => 'Angemeldet bleiben',
18 | 'submit' => 'Anmelden',
19 | ),
20 | ),
21 |
22 | 'account' => array(
23 | 'title' => 'Dein Konto',
24 | 'headline' => 'Dein Konto',
25 |
26 | 'form' => array(
27 | 'email' => 'E-Mail Adresse',
28 | 'first_name' => 'Vorname',
29 | 'last_name' => 'Nachname',
30 | 'old-password' => 'Aktuelles Passwort',
31 | 'submit' => 'Speichern',
32 | ),
33 | ),
34 |
35 | 'register' => array(
36 | 'title' => 'Registrieren',
37 | 'headline' => 'Neuen Benutzer anlegen',
38 |
39 | 'activation' => 'Ihr Konto wurde erfolgreich angelegt! Bitte prüfe deine E-Mails und bestätige sie mit einem Klick auf den Aktivierungs-Code.',
40 | 'email-required' => 'Du musst eine E-Mail Adresse angeben!',
41 | 'password-required' => 'Du musst ein Passwort angeben!',
42 | 'email-unique' => 'Es gibt bereits einen Benutzer mit dem Passwort! Möchtest du dich lieber anmelden ?',
43 |
44 | 'form' => array(
45 | 'email' => 'E-Mail Adresse',
46 | 'password' => 'Passwort',
47 | 'password_repeat' => 'Passwort wiederholen',
48 | 'submit' => 'Registrieren',
49 | ),
50 |
51 | 'social' => array(
52 | 'github' => array(
53 | 'no-emails' => 'In Ihrem GitHub Konto konnten keine E-Mail Adresse gefunden werden! Bitte fügen Sie eine E-Mail Adresse zu Ihrem GitHub Konto hinzu oder versuchen Sie die Registrierung mit einem anderen Dienst.',
54 | 'login' => 'Anmelden mit GitHub ',
55 | ),
56 | ),
57 | ),
58 |
59 | 'social' => array(
60 | 'title' => 'Registrieren',
61 | 'headline' => 'Wählen Sie Ihre primäre E-Mail Adresse',
62 | 'description' => 'In Ihrem Konto wurden mehrere E-Mail Adressen gefunden, bitte wählen Sie die E-Mail Adresse aus mit der Sie sich registrieren wollen.',
63 | 'submit' => 'Registrieren',
64 | ),
65 |
66 | 'activate' => array(
67 | 'not-found' => 'Dein Aktivierungs-Code wurde nicht gefunden! Bitte registriere dich noch einmal.',
68 | 'success' => 'Dein Konto wurde erfolgreich aktiviert.',
69 | 'error' => 'Dein Konto konnte aus unbekannten Gründen nicht aktiviert werden. Bitte wende dich an den Kontakt',
70 | 'already-activated' => 'Du hast dein Konto schon aktiviert! Du kannst dich jetzt direkt anmelden.',
71 |
72 | 'email' => array(
73 | 'title' => 'E-Mail bestätigen',
74 | 'headline' => 'Bestätige deine E-Mail',
75 | 'subject' => 'Bestätige deine Ping Konto',
76 | 'content' => 'Deine E-Mail Adresse wurde benutzt um dich bei Ping zu registrieren! Bestätige jetzt deine E-Mail oder ignoriere sie wenn du dich nicht registriert hast.',
77 | ),
78 | ),
79 | );
--------------------------------------------------------------------------------
/app/lang/de/validation.php:
--------------------------------------------------------------------------------
1 | ":attribute muss akzeptiert werden.",
17 | "active_url" => ":attribute ist keine gültige Internet-Adresse.",
18 | "after" => ":attribute muss ein Datum nach dem :date sein.",
19 | "alpha" => ":attribute darf nur aus Buchstaben bestehen.",
20 | "alpha_dash" => ":attribute darf nur aus Buchstaben, Zahlen, Binde- und Unterstrichen bestehen. Umlaute (ä, ö, ü) und Eszett (ß) sind nicht erlaubt.",
21 | "alpha_num" => ":attribute darf nur aus Buchstaben und Zahlen bestehen.",
22 | "array" => ":attribute muss ein Array sein.",
23 | "before" => ":attribute muss ein Datum vor dem :date sein.",
24 | "between" => array(
25 | "numeric" => ":attribute muss zwischen :min & :max liegen.",
26 | "file" => ":attribute muss zwischen :min & :max Kilobytes groß sein.",
27 | "string" => ":attribute muss zwischen :min & :max Zeichen lang sein.",
28 | "array" => ":attribute muss zwischen :min & :max Elemente haben."
29 | ),
30 | "confirmed" => ":attribute stimmt nicht mit der Bestätigung überein.",
31 | "date" => ":attribute muss ein gültiges Datum sein.",
32 | "date_format" => ":attribute entspricht nicht dem gültigen Format für :format.",
33 | "different" => ":attribute und :other müssen sich unterscheiden.",
34 | "digits" => ":attribute muss :digits Stellen haben.",
35 | "digits_between" => ":attribute muss zwischen :min und :max Stellen haben.",
36 | "email" => ":attribute Format ist ungültig.",
37 | "exists" => "Der gewählte Wert für :attribute ist ungültig.",
38 | "image" => ":attribute muss ein Bild sein.",
39 | "in" => "Der gewählte Wert für :attribute ist ungültig.",
40 | "integer" => ":attribute muss eine ganze Zahl sein.",
41 | "ip" => ":attribute muss eine gültige IP-Adresse sein.",
42 | "max" => array(
43 | "numeric" => ":attribute darf maximal :max sein.",
44 | "file" => ":attribute darf maximal :max Kilobytes groß sein.",
45 | "string" => ":attribute darf maximal :max Zeichen haben.",
46 | "array" => ":attribute darf nicht mehr als :max Elemente haben."
47 | ),
48 | "mimes" => ":attribute muss den Dateityp :values haben.",
49 | "min" => array(
50 | "numeric" => ":attribute muss mindestens :min sein.",
51 | "file" => ":attribute muss mindestens :min Kilobytes groß sein.",
52 | "string" => ":attribute muss mindestens :min Zeichen lang sein.",
53 | "array" => ":attribute muss mindestens :min Elemente haben."
54 | ),
55 | "not_in" => "Der gewählte Wert für :attribute ist ungültig.",
56 | "numeric" => ":attribute muss eine Zahl sein.",
57 | "regex" => ":attribute Format ist ungültig.",
58 | "required" => ":attribute darf nicht leer sein.",
59 | "required_if" => ":attribute muss ausgefüllt sein wenn :other :value ist.",
60 | "required_with" => ":attribute muss angegeben werden wenn :values ausgefüllt wurde.",
61 | "required_without" => ":attribute muss angegeben werden wenn :values nicht ausgefüllt wurde.",
62 | "same" => ":attribute und :other müssen übereinstimmen.",
63 | "size" => array(
64 | "numeric" => ":attribute muss gleich :size sein.",
65 | "file" => ":attribute muss :size Kilobyte groß sein.",
66 | "string" => ":attribute muss :size Zeichen lang sein.",
67 | "array" => ":attribute muss genau :size Elemente haben."
68 | ),
69 | "unique" => ":attribute ist schon vergeben.",
70 | "url" => "Das Format von :attribute ist ungültig.",
71 |
72 | 'attributes' => array(
73 | 'name' => 'Name',
74 | 'company_id' => 'Unternehmen',
75 | 'email' => 'E-Mail',
76 | 'url' => 'URL',
77 | 'port' => 'Port',
78 | 'interval' => 'Intervall',
79 | 'latency_satisfied' => 'Latenz - Zufriedenstellend',
80 | 'latency_tolerating' => 'Latenz - Toleriert',
81 | ),
82 | );
--------------------------------------------------------------------------------
/app/lang/en/base.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'login' => 'Login',
6 | 'register' => 'Sign Up',
7 | 'companies' => 'Companies',
8 | 'checks' => 'Checks',
9 | 'account' => 'Account',
10 | 'logout' => 'Logout',
11 | ),
12 | );
13 |
--------------------------------------------------------------------------------
/app/lang/en/check.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'days' => 'Day|Days',
6 | 'hours' => 'Hour|Hours',
7 | 'minutes' => 'Minute|Minutes',
8 | ),
9 |
10 | 'index' => array(
11 | 'title' => 'Checks',
12 | 'headline' => 'Checks',
13 | 'empty' => 'You did not create any checks yet. Do you want to create a check now ?',
14 | 'create' => 'Create check',
15 | '24h' => 'Last 24h',
16 | 'url' => 'URL',
17 | 'user' => 'User',
18 | 'company' => 'Company',
19 | 'interval' => 'Interval',
20 | 'show' => 'Display',
21 | 'edit' => 'Edit',
22 | 'delete' => 'Delete',
23 | 'pause' => 'Pause',
24 | 'unpause' => 'Continue',
25 | ),
26 |
27 | 'show' => array(
28 | 'title' => 'Check :title',
29 | 'headline' => ':title',
30 | 'uptime' => 'Uptime',
31 | 'success' => 'Available',
32 | 'begin' => 'Begin',
33 | 'end' => 'End',
34 | 'duration' => 'Duration',
35 | 'latency' => 'Latency',
36 | 'delete' => 'Delete check',
37 | ),
38 |
39 | 'create' => array(
40 | 'title' => 'Create check',
41 | 'headline' => 'New Check',
42 | 'submit' => 'Create check',
43 | 'success' => 'The check was created successfully.',
44 | ),
45 |
46 | 'form' => array(
47 | 'company_id' => 'Company',
48 | 'url' => 'URL',
49 | 'url-placeholder' => 'http://www.google.com',
50 | 'port' => 'Port',
51 | 'username' => 'Username (HTTP-Auth)',
52 | 'password' => 'Password (HTTP-Auth)',
53 | 'check_for' => 'Search in body',
54 | 'interval' => 'Interval (in minutes)',
55 | 'notify_failed_checks' => 'Notification of failed checks',
56 | 'notify_back_online' => 'Notification of a successfull check after a failed one',
57 | 'latency_satisfied' => 'Latency - Satisfied (in seconds)',
58 | 'latency_tolerating' => 'Latency - Tolerated (in seconds)',
59 | ),
60 |
61 | 'edit' => array(
62 | 'title' => 'Edit check',
63 | 'headline' => 'Edit :url',
64 | 'submit' => 'Edit check',
65 | 'success' => 'You successfully edited the check.',
66 | ),
67 |
68 | 'delete' => array(
69 | 'success' => 'The check :url was successfully deleted! You can restore it.'
70 | ),
71 |
72 | 'errors' => array(
73 | 'resolve-host' => 'Host :host could not be resolved',
74 | ),
75 |
76 | 'job' => array(
77 | 'email' => array(
78 | 'online' => array(
79 | 'subject' => '[ping] :title is back online!',
80 | 'title' => ':title is online',
81 | 'headline' => ':title is online',
82 | 'content' => ':title is online again.',
83 | ),
84 |
85 | 'offline' => array(
86 | 'subject' => '[ping] :title is offline!',
87 | 'title' => ':title is offline',
88 | 'headline' => ':title is offline',
89 | 'content' => ':title is offline because of the error :code !',
90 | ),
91 | ),
92 | ),
93 |
94 | 'pause' => array(
95 | 'success' => 'The check was successfully paused.',
96 | ),
97 |
98 | 'unpause' => array(
99 | 'success' => 'The check is queued again.',
100 | ),
101 | );
--------------------------------------------------------------------------------
/app/lang/en/company.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'title' => 'Company',
6 | 'headline' => 'Company',
7 | 'create' => 'Create new company',
8 | 'name' => 'Name',
9 | 'users' => 'User',
10 | 'show' => 'Display',
11 | 'edit' => 'Edit',
12 | 'delete' => 'Delete',
13 | 'add-user' => 'Create user',
14 | 'empty' => 'You did not create a company yet. Do you want to create a company now?',
15 | ),
16 |
17 | 'user' => array(
18 | 'add' => array(
19 | 'title' => 'Add a user',
20 | 'description' => 'Add a user to this company. At the moment you only can add already registered users.',
21 | 'user' => 'Email address',
22 | 'close' => 'Cancel',
23 | 'invite' => 'Add',
24 | 'success' => 'The user was added to the company.',
25 | 'user-not-found' => 'An user with the email address does not exist yet!',
26 | 'user-already-added' => 'The user already has access to the company!',
27 | ),
28 |
29 | 'remove' => array(
30 | 'not-found' => 'The user could not be found in this company!',
31 | 'not-creator' => 'You cannot delete the creator of the company!',
32 | 'success' => 'The user was removed from the company.',
33 | ),
34 | ),
35 |
36 | 'show' => array(
37 | 'title' => ':name',
38 | 'headline' => ':name',
39 | 'delete' => 'Delete company',
40 | ),
41 |
42 | 'create' => array(
43 | 'title' => 'Create new company',
44 | 'headline' => 'New Company',
45 | 'submit' => 'Create company',
46 | 'success' => 'You successfully created the company.',
47 | ),
48 |
49 | 'edit' => array(
50 | 'title' => 'Edit :name',
51 | 'headline' => 'Edit :name',
52 | 'submit' => 'Edit company',
53 | 'success' => 'The company was edited successfully.'
54 | ),
55 |
56 | 'delete' => array(
57 | 'success' => ':name was successfully deleted! You can restore it.'
58 | ),
59 |
60 | 'form' => array(
61 | 'name' => 'Name',
62 | ),
63 | );
--------------------------------------------------------------------------------
/app/lang/en/dashboard.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'title' => 'Dashboard',
6 | 'headline' => 'Dashboard',
7 | ),
8 | );
--------------------------------------------------------------------------------
/app/lang/en/home.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'title' => 'Ping - Website status monitor',
6 | 'headline' => 'Ping - Webseiten status monitor',
7 | 'intro' => 'Ping monitors your website status by requesting the server periodicaly. You can get informed via email if one of your websites is down.',
8 | 'register' => 'Sign Up',
9 | 'checks' => 'Your Checks',
10 | ),
11 | );
--------------------------------------------------------------------------------
/app/lang/en/user.php:
--------------------------------------------------------------------------------
1 | array(
5 | 'title' => 'Login',
6 | 'headline' => 'Login',
7 |
8 | 'no-email' => 'The email address is required!',
9 | 'not-activated' => 'The account is not activated!',
10 | 'unknown' => 'The email address or password is wrong!',
11 | 'suspended' => 'The account was deactivated!',
12 | 'banned' => 'The account was closed!',
13 |
14 | 'form' => array(
15 | 'email' => 'Email address',
16 | 'password' => 'Password',
17 | 'remember' => 'Stay signed in',
18 | 'submit' => 'Login',
19 | ),
20 | ),
21 |
22 | 'account' => array(
23 | 'title' => 'Your account',
24 | 'headline' => 'Your account',
25 |
26 | 'form' => array(
27 | 'email' => 'E-mail address',
28 | 'first_name' => 'First name',
29 | 'last_name' => 'Last name',
30 | 'old-password' => 'Current password',
31 | 'submit' => 'Save account',
32 | ),
33 | ),
34 |
35 | 'register' => array(
36 | 'title' => 'Sign Up',
37 | 'headline' => 'Sign up for a new account',
38 |
39 | 'activation' => 'Your account was created successfully! Please check your mails and confirm your mail address.',
40 | 'email-required' => 'You have to enter an email!',
41 | 'password-required' => 'You have to enter a password!',
42 | 'email-unique' => 'An user with your email already has an account! Do you want to login ?',
43 |
44 | 'form' => array(
45 | 'email' => 'Email address',
46 | 'password' => 'Password',
47 | 'password_repeat' => 'Repeat password',
48 | 'submit' => 'Sign Up',
49 | ),
50 | ),
51 |
52 | 'activate' => array(
53 | 'not-found' => 'Your activation code could not be found! Please sign up again.',
54 | 'success' => 'Your account was created successfully.',
55 | 'error' => 'For unknown reasons your account could not be created. Please contact us for further help.',
56 | 'already-activated' => 'You already confirmed your account! You can login with your email and password.',
57 |
58 | 'email' => array(
59 | 'title' => 'Confirm email',
60 | 'headline' => 'Confirm your email',
61 | 'subject' => 'Confirm your Ping account',
62 | 'content' => 'Your email address was used to create a Ping account! Confirm your email or or ignore this email if you did not sign up.',
63 | ),
64 | ),
65 | );
--------------------------------------------------------------------------------
/app/lang/en/validation.php:
--------------------------------------------------------------------------------
1 | 'The :attribute must be accepted.',
5 | 'active_url' => 'The :attribute is not a valid URL.',
6 | 'after' => 'The :attribute must be a date after :date.',
7 | 'alpha' => 'The :attribute may only contain letters.',
8 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.',
9 | 'alpha_num' => 'The :attribute may only contain letters and numbers.',
10 | 'array' => 'The :attribute must be an array.',
11 | 'before' => 'The :attribute must be a date before :date.',
12 | 'between' => array(
13 | 'numeric' => 'The :attribute must be between :min and :max.',
14 | 'file' => 'The :attribute must be between :min and :max kilobytes.',
15 | 'string' => 'The :attribute must be between :min and :max characters.',
16 | 'array' => 'The :attribute must have between :min and :max items.',
17 | ),
18 | 'confirmed' => 'The :attribute confirmation does not match.',
19 | 'date' => 'The :attribute is not a valid date.',
20 | 'date_format' => 'The :attribute does not match the format :format.',
21 | 'different' => 'The :attribute and :other must be different.',
22 | 'digits' => 'The :attribute must be :digits digits.',
23 | 'digits_between' => 'The :attribute must be between :min and :max digits.',
24 | 'email' => 'The :attribute format is invalid.',
25 | 'exists' => 'The selected :attribute is invalid.',
26 | 'image' => 'The :attribute must be an image.',
27 | 'in' => 'The selected :attribute is invalid.',
28 | 'integer' => 'The :attribute must be an integer.',
29 | 'ip' => 'The :attribute must be a valid IP address.',
30 | 'max' => array(
31 | 'numeric' => 'The :attribute may not be greater than :max.',
32 | 'file' => 'The :attribute may not be greater than :max kilobytes.',
33 | 'string' => 'The :attribute may not be greater than :max characters.',
34 | 'array' => 'The :attribute may not have more than :max items.',
35 | ),
36 | 'mimes' => 'The :attribute must be a file of type: :values.',
37 | 'min' => array(
38 | 'numeric' => 'The :attribute must be at least :min.',
39 | 'file' => 'The :attribute must be at least :min kilobytes.',
40 | 'string' => 'The :attribute must be at least :min characters.',
41 | 'array' => 'The :attribute must have at least :min items.',
42 | ),
43 | 'not_in' => 'The selected :attribute is invalid.',
44 | 'numeric' => 'The :attribute must be a number.',
45 | 'regex' => 'The :attribute format is invalid.',
46 | 'required' => 'The :attribute field is required.',
47 | 'required_if' => 'The :attribute field is required when :other is :value.',
48 | 'required_with' => 'The :attribute field is required when :values is present.',
49 | 'required_without' => 'The :attribute field is required when :values is not present.',
50 | 'same' => 'The :attribute and :other must match.',
51 | 'size' => array(
52 | 'numeric' => 'The :attribute must be :size.',
53 | 'file' => 'The :attribute must be :size kilobytes.',
54 | 'string' => 'The :attribute must be :size characters.',
55 | 'array' => 'The :attribute must contain :size items.',
56 | ),
57 | 'unique' => 'The :attribute has already been taken.',
58 | 'url' => 'The :attribute format is invalid.',
59 |
60 | 'attributes' => array(
61 | 'name' => 'Name',
62 | 'company_id' => 'Company',
63 | 'email' => 'E-mail',
64 | 'url' => 'URL',
65 | 'port' => 'Port',
66 | 'interval' => 'Interval',
67 | 'latency_satisfied' => 'Latency - Satisfied',
68 | 'latency_tolerating' => 'Latency - Tolerated',
69 | ),
70 | );
71 |
--------------------------------------------------------------------------------
/app/models/Check.php:
--------------------------------------------------------------------------------
1 | url);
28 | $title = str_replace('www.', '', $title);
29 | $title = str_finish($title, '/');
30 |
31 | $title = substr($title, 0, strlen($title) - 1);
32 |
33 | return $title;
34 | }
35 |
36 | public function getStatusOkAttribute()
37 | {
38 | $results = $this->results()
39 | ->orderBy('created_at', 'desc')
40 | ->take(1)
41 | ->get();
42 |
43 | if (count($results) == 0)
44 | return null;
45 |
46 | return (bool) $results->first()->success;
47 | }
48 |
49 | public function getIntervalFormattedAttribute()
50 | {
51 | return $this->interval . ' ' . Lang::choice('check.diff.minutes', $this->interval);
52 | }
53 |
54 | public function isPaused()
55 | {
56 | return (bool) ($this->paused);
57 | }
58 |
59 | public function scopeForUser(Illuminate\Database\Eloquent\Builder $query, $userId)
60 | {
61 | return $query->join('users_companies', 'users_companies.company_id', '=', 'checks.company_id')
62 | ->where(function($query) use($userId) {
63 | $query->where('users_companies.user_id', '=', $userId)
64 | ->orWhere('checks.user_id', '=', $userId);
65 | });
66 | }
67 |
68 | public function minutesToHuman($seconds)
69 | {
70 | $minutes = $seconds / 60;
71 |
72 | $d = floor($minutes / 1440);
73 | $h = floor($minutes / 60) % 24;
74 | $m = $minutes % 60;
75 |
76 | $return = '';
77 | if ($d > 0)
78 | $return .= $d . ' ' . Lang::choice('check.diff.days', $d) . ' ';
79 |
80 | if ($h > 0)
81 | $return .= $h . ' ' . Lang::choice('check.diff.hours', $h) . ' ';
82 |
83 | if ($m > 0)
84 | $return .= $m . ' ' . Lang::choice('check.diff.minutes', $m);
85 |
86 | return $return;
87 | }
88 |
89 | public function getLog($offset = 0, $limit = 20)
90 | {
91 | $offset = intval($offset);
92 | $limit = intval($limit);
93 |
94 | $controller = $this;
95 |
96 | $data = DB::select(DB::raw('SELECT MIN(`created_at`) AS `start`,
97 | MAX(`created_at`) AS `end`,
98 | MAX(UNIX_TIMESTAMP(`created_at`)) - MIN(UNIX_TIMESTAMP(`created_at`)) + 1 `duration`,
99 | `success`
100 | FROM (
101 | SELECT
102 | `t`.`id`,
103 | `t`.`created_at`,
104 | if (@last_success = success, @group, @group:=@group+1) group_number,
105 | @last_success := success as success
106 | FROM `' . DB::getTablePrefix() . 'checks_results` AS `t`
107 | CROSS JOIN (
108 | SELECT @last_status := null, @group:=0
109 | ) as `init_vars`
110 | ORDER BY `t`.`created_at`
111 | ) q
112 | GROUP BY `group_number`
113 | ORDER BY `start` DESC
114 | LIMIT ' . $offset . ', ' . $limit . ''
115 | ));
116 |
117 | $data = array_map(function($date) use($controller) {
118 | return array(
119 | 'start' => new \Carbon\Carbon($date->start),
120 | 'end' => new \Carbon\Carbon($date->end),
121 | 'duration' => $date->duration,
122 | 'duration_locale' => $controller->minutesToHuman($date->duration),
123 | 'success' => (bool) $date->success,
124 | );
125 | }, $data);
126 |
127 | return $data;
128 | }
129 |
130 | private function statusCount($success, $hours)
131 | {
132 | return CheckResult::where('check_id', '=', $this->id)
133 | ->where('success', '=', $success)
134 | ->where('created_at', '>=', DB::raw(sprintf('DATE_SUB(NOW(), INTERVAL %s HOUR)', $hours)))
135 | ->count();
136 | }
137 |
138 | public function successCount($hours = 1)
139 | {
140 | return $this->statusCount(1, $hours);
141 | }
142 |
143 | public function errorCount($hours = 1)
144 | {
145 | return $this->statusCount(0, $hours);
146 | }
147 |
148 | public function theUser()
149 | {
150 | return $this->belongsTo('User', 'user_id');
151 | }
152 |
153 | public function theCompany()
154 | {
155 | return $this->belongsTo('Company', 'company_id');
156 | }
157 |
158 | public function results()
159 | {
160 | return $this->hasMany('CheckResult', 'check_id');
161 | }
162 | }
--------------------------------------------------------------------------------
/app/models/CheckResult.php:
--------------------------------------------------------------------------------
1 | select('companies.*')
17 | ->join('users_companies', 'users_companies.company_id', '=', 'companies.id')
18 | ->where('users_companies.user_id', '=', $userId);
19 | }
20 |
21 | public function users()
22 | {
23 | return $this->belongsToMany('User', 'users_companies', 'company_id', 'user_id');
24 | }
25 | }
--------------------------------------------------------------------------------
/app/models/User.php:
--------------------------------------------------------------------------------
1 | getKey();
37 | }
38 |
39 | /**
40 | * Get the password for the user.
41 | *
42 | * @return string
43 | */
44 | public function getAuthPassword()
45 | {
46 | return $this->password;
47 | }
48 |
49 | /**
50 | * Get the e-mail address where password reminders are sent.
51 | *
52 | * @return string
53 | */
54 | public function getReminderEmail()
55 | {
56 | return $this->email;
57 | }
58 |
59 | /**
60 | * Get the token value for the "remember me" session.
61 | *
62 | * @return string
63 | */
64 | public function getRememberToken()
65 | {
66 | return $this->remember_token;
67 | }
68 |
69 | /**
70 | * Set the token value for the "remember me" session.
71 | *
72 | * @param string $value
73 | * @return void
74 | */
75 | public function setRememberToken($value)
76 | {
77 | $this->remember_token = $value;
78 | }
79 |
80 | /**
81 | * Get the column name for the "remember me" token.
82 | *
83 | * @return string
84 | */
85 | public function getRememberTokenName()
86 | {
87 | return 'remember_token';
88 | }
89 | }
--------------------------------------------------------------------------------
/app/models/UserCompany.php:
--------------------------------------------------------------------------------
1 | with('session', Session::all());
12 | $view->with('guest', $guest);
13 | $view->with('user', $user);
14 | });
15 |
16 | Route::get('/imprint', array(
17 | 'as' => 'imprint',
18 | 'uses' => 'HomeController@imprint',
19 | ));
20 |
21 | Route::get('/privacy', array(
22 | 'as' => 'privacy',
23 | 'uses' => 'HomeController@privacy',
24 | ));
25 |
26 | /**
27 | * Account
28 | */
29 | Route::get('/', array(
30 | 'as' => 'home',
31 | 'uses' => 'HomeController@index',
32 | ));
33 |
34 | Route::group(array((Config::get('app.forceSsl')) ? 'https' : 'http'), function() {
35 | Route::get('/login', array(
36 | 'as' => 'user.login',
37 | 'uses' => 'UserController@login',
38 | ));
39 |
40 | Route::post('/login', array(
41 | 'as' => 'user.do-login',
42 | 'uses' => 'UserController@doLogin',
43 | 'before' => 'csrf',
44 | ));
45 |
46 | Route::get('/login/github', array(
47 | 'as' => 'user.login.github',
48 | 'uses' => 'UserController@loginGithub',
49 | ));
50 |
51 | Route::post('/login/github', array(
52 | 'as' => 'user.login.github',
53 | 'uses' => 'UserController@loginGithub',
54 | ));
55 |
56 | Route::get('/register', array(
57 | 'as' => 'user.register',
58 | 'uses' => 'UserController@register',
59 | ));
60 |
61 | Route::post('/register', array(
62 | 'as' => 'user.do-register',
63 | 'uses' => 'UserController@doRegister',
64 | 'before' => 'csrf',
65 | ));
66 |
67 | Route::get('/activate/{code}', array(
68 | 'as' => 'user.activate',
69 | 'uses' => 'UserController@activate',
70 | ))
71 | ->where('code', '\w+');
72 | });
73 |
74 | Route::group(array('before' => 'auth', (Config::get('app.forceSsl')) ? 'https' : 'http'), function() {
75 | /**
76 | * Users
77 | */
78 | Route::get('/account', array(
79 | 'as' => 'user.account',
80 | 'uses' => 'UserController@account',
81 | ));
82 |
83 | Route::post('/account', array(
84 | 'as' => 'user.save',
85 | 'uses' => 'UserController@save',
86 | ));
87 |
88 | Route::get('/logout', array(
89 | 'as' => 'user.logout',
90 | 'uses' => 'UserController@logout',
91 | ));
92 |
93 | /**
94 | * Companies
95 | */
96 | Route::get('/companies', array(
97 | 'as' => 'company.index',
98 | 'uses' => 'CompanyController@index',
99 | ));
100 |
101 | Route::get('/companies/{id}/user/remove/{user}', array(
102 | 'as' => 'company.user.remove',
103 | 'uses' => 'CompanyController@removeUser',
104 | ))
105 | ->where('id', '\d+')
106 | ->where('user', '\d+');
107 |
108 | Route::post('/companies/{id}/user/add', array(
109 | 'as' => 'company.user.add',
110 | 'uses' => 'CompanyController@addUser',
111 | ))
112 | ->where('id', '\d+');
113 |
114 | Route::get('/company/{id}', array(
115 | 'as' => 'company.show',
116 | 'uses' => 'CompanyController@show',
117 | ))->where('id', '\d+');
118 |
119 | Route::get('/company/create', array(
120 | 'as' => 'company.create',
121 | 'uses' => 'CompanyController@create',
122 | ));
123 |
124 | Route::post('/company/create', array(
125 | 'as' => 'company.store',
126 | 'uses' => 'CompanyController@store',
127 | ));
128 |
129 | Route::get('/company/{id}/edit', array(
130 | 'as' => 'company.edit',
131 | 'uses' => 'CompanyController@edit',
132 | ))->where('id', '\d+');
133 |
134 | Route::post('/company/{id}/update', array(
135 | 'as' => 'company.update',
136 | 'uses' => 'CompanyController@update',
137 | ))->where('id', '\d+');
138 |
139 | Route::get('/company/{id}/delete', array(
140 | 'as' => 'company.delete',
141 | 'uses' => 'CompanyController@delete',
142 | ))->where('id', '\d+');
143 |
144 | Route::get('/company/{id}/restore', array(
145 | 'as' => 'company.restore',
146 | 'uses' => 'CompanyController@restore',
147 | ))->where('id', '\d+');
148 |
149 | /**
150 | * Checks
151 | */
152 | Route::get('/checks', array(
153 | 'as' => 'check.index',
154 | 'uses' => 'CheckController@index',
155 | ));
156 |
157 | Route::get('/check/{id}', array(
158 | 'as' => 'check.show',
159 | 'uses' => 'CheckController@show',
160 | ))->where('id', '\d+');
161 |
162 | Route::get('/check/create', array(
163 | 'as' => 'check.create',
164 | 'uses' => 'CheckController@create',
165 | ));
166 |
167 | Route::post('/check/store', array(
168 | 'as' => 'check.store',
169 | 'uses' => 'CheckController@store',
170 | ));
171 |
172 | Route::get('/check/{id}/edit', array(
173 | 'as' => 'check.edit',
174 | 'uses' => 'CheckController@edit',
175 | ))->where('id', '\d+');
176 |
177 | Route::post('/check/{id}/update', array(
178 | 'as' => 'check.update',
179 | 'uses' => 'CheckController@update',
180 | ))->where('id', '\d+');
181 |
182 | Route::get('/check/{id}/delete', array(
183 | 'as' => 'check.delete',
184 | 'uses' => 'CheckController@delete',
185 | ))->where('id', '\d+');
186 |
187 | Route::get('/check/{id}/restore', array(
188 | 'as' => 'check.restore',
189 | 'uses' => 'CheckController@restore',
190 | ))->where('id', '\d+');
191 |
192 | Route::get('/check/{id}/pause', array(
193 | 'as' => 'check.pause',
194 | 'uses' => 'CheckController@pause',
195 | ))->where('id', '\d+');
196 |
197 | Route::get('/check/{id}/unpause', array(
198 | 'as' => 'check.unpause',
199 | 'uses' => 'CheckController@unpause',
200 | ))->where('id', '\d+');
201 |
202 | /**
203 | * API
204 | */
205 | Route::get('/api/check/{id}/uptime', array(
206 | 'as' => 'api.check.uptime',
207 | 'uses' => 'ApiController@checkUptime',
208 | ))->where('id', '\d+');
209 |
210 | Route::get('/api/check/{id}/log', array(
211 | 'as' => 'api.check.log',
212 | 'uses' => 'ApiController@checkLog',
213 | ))->where('id', '\d+');
214 |
215 | Route::get('/api/check/{id}/latency', array(
216 | 'as' => 'api.check.latency',
217 | 'uses' => 'ApiController@checkLatency',
218 | ))->where('id', '\d+');
219 | });
--------------------------------------------------------------------------------
/app/start/artisan.php:
--------------------------------------------------------------------------------
1 | getMessage()));
52 | });
53 |
54 | /*
55 | |--------------------------------------------------------------------------
56 | | Maintenance Mode Handler
57 | |--------------------------------------------------------------------------
58 | |
59 | | The "down" Artisan command gives you the ability to put an application
60 | | into maintenance mode. Here, you will define what is displayed back
61 | | to the user if maintenance mode is in effect for the application.
62 | |
63 | */
64 |
65 | App::down(function()
66 | {
67 | return Response::make("Be right back!", 503);
68 | });
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Require The Filters File
73 | |--------------------------------------------------------------------------
74 | |
75 | | Next we will load the filters file for the application. This gives us
76 | | a nice separate location to store our route and application filter
77 | | definitions instead of putting them all in the main routes file.
78 | |
79 | */
80 |
81 | require app_path().'/filters.php';
82 |
--------------------------------------------------------------------------------
/app/start/local.php:
--------------------------------------------------------------------------------
1 | client->request('GET', '/');
13 |
14 | $this->assertTrue($this->client->getResponse()->isOk());
15 | }
16 |
17 | }
--------------------------------------------------------------------------------
/app/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | 'check.store', 'method' => 'post', 'class' => 'form-horizontal'))
4 | : Form::model($check, array('route' => array('check.update', $check->id), 'method' => 'post', 'class' => 'form-horizontal'))
5 | }}
6 |
7 |
18 |
19 |
30 |
31 |
42 |
43 |
54 |
55 |
66 |
67 |
78 |
79 |
90 |
91 |
102 |
103 |
114 |
115 |
126 |
127 |
138 |
139 |
144 |
145 | {{ Form::close() }}
--------------------------------------------------------------------------------
/app/views/check/create.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('check.create.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('check.create.headline') }}
9 |
10 | @include('/check/_form', array('check' => $check, 'new' => true, 'companies' => $companies))
11 | @stop
--------------------------------------------------------------------------------
/app/views/check/edit.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('check.edit.title', array('url' => $check->url)) }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('check.edit.headline', array('url' => $check->url)) }}
9 |
10 | @include('/check/_form', array('check' => $check, 'new' => false, 'companies' => $companies))
11 | @stop
--------------------------------------------------------------------------------
/app/views/check/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('check.index.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('check.index.headline') }}
9 |
10 | @if (count($checks))
11 |
12 |
13 |
14 |
15 |
16 | {{ trans('check.index.24h') }}
17 | {{ trans('check.index.url') }}
18 | {{ trans('check.index.user') }}
19 | {{ trans('check.index.company') }}
20 | {{ trans('check.index.interval') }}
21 |
22 |
23 |
24 |
25 | @foreach ($checks as $check)
26 | statusOk; ?>
27 |
28 |
29 | @if ($status === null)
30 | @elseif ($status)
31 |
32 | @else
33 |
34 | @endif
35 |
36 |
37 | {{ $check->successCount(24) }}
38 | {{ $check->errorCount(24) }}
39 |
40 | {{{ $check->url }}}
41 | {{{ $check->theUser->email }}}
42 | {{{ $check->theCompany->name }}}
43 | {{{ $check->intervalFormatted }}}
44 |
45 |
63 |
64 |
65 | @endforeach
66 |
67 |
68 |
69 | @else
70 | {{ trans('check.index.empty', array('createUrl' => URL::route('check.create'))) }}
71 | @endif
72 | @stop
--------------------------------------------------------------------------------
/app/views/check/show.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('check.show.title', array('title' => $check->title)) }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('check.show.headline', array('title' => $check->title)) }}
9 |
10 | {{ trans('check.show.uptime') }}
11 |
12 |
13 |
14 |
15 |
16 |
17 | {{ trans('check.show.success') }}
18 | {{ trans('check.show.begin') }}
19 | {{ trans('check.show.end') }}
20 | {{ trans('check.show.duration') }}
21 |
22 |
23 |
24 | @foreach ($log as $date)
25 |
26 |
27 | @if ($date['success'] == 1)
28 |
29 | @else
30 |
31 | @endif
32 |
33 | {{{ $date['start']->format(Config::get('app.format.datetime')) }}}
34 | {{{ $date['end']->format(Config::get('app.format.datetime')) }}}
35 | {{{ $date['duration_locale'] }}}
36 |
37 | @endforeach
38 |
39 |
40 |
41 | {{ trans('check.show.latency') }}
42 |
43 |
44 |
45 |
46 | {{ trans('check.show.delete') }}
47 |
48 | @stop
--------------------------------------------------------------------------------
/app/views/company/_form.blade.php:
--------------------------------------------------------------------------------
1 | {{
2 | $new
3 | ? Form::model($company, array('route' => 'company.store', 'method' => 'post', 'class' => 'form-horizontal'))
4 | : Form::model($company, array('route' => array('company.update', $company->id), 'method' => 'post', 'class' => 'form-horizontal'))
5 | }}
6 |
7 |
18 |
19 |
24 |
25 | {{ Form::close() }}
--------------------------------------------------------------------------------
/app/views/company/create.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('company.create.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('company.create.headline') }}
9 |
10 | @include('/company/_form', array('company' => null, 'new' => true))
11 | @stop
--------------------------------------------------------------------------------
/app/views/company/edit.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('company.edit.title', array('name' => $company->name)) }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('company.edit.headline', array('name' => $company->name)) }}
9 |
10 | @include('/company/_form', array('company' => $company, 'new' => false))
11 | @stop
--------------------------------------------------------------------------------
/app/views/company/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('company.index.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('company.index.headline') }}
9 |
10 | @if (count($companies))
11 |
12 |
13 |
14 |
15 | {{ trans('company.index.name') }}
16 | {{ trans('company.index.users') }}
17 |
18 |
19 |
20 |
21 | @foreach ($companies as $company)
22 |
23 | {{{ $company->name }}}
24 |
25 |
26 | @foreach ($company->users as $companyUser)
27 |
28 | {{{ $companyUser->email }}}
29 | @if ($company->user_id != $companyUser->id)
30 |
31 | @endif
32 |
33 | @endforeach
34 |
35 |
36 |
37 |
52 |
53 |
54 |
55 |
83 | @endforeach
84 |
85 |
86 |
87 | @else
88 | {{ trans('company.index.empty', array('createUrl' => URL::route('company.create'))) }}
89 | @endif
90 | @stop
--------------------------------------------------------------------------------
/app/views/company/show.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('company.show.title', array('name' => $company->name)) }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('company.show.headline', array('name' => $company->name)) }}
9 |
10 |
11 | @foreach ($company->users as $user)
12 | {{{ $user->email }}}
13 | @endforeach
14 |
15 |
16 |
17 | {{ trans('company.show.delete') }}
18 |
19 | @stop
--------------------------------------------------------------------------------
/app/views/email/activate.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.email')
2 |
3 | @section('title')
4 | {{ trans('user.activate.email.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('user.activate.email.headline') }}
9 |
10 | {{ trans('user.activate.email.content', array('url' => $activationUrl)) }}
11 | @stop
--------------------------------------------------------------------------------
/app/views/email/check/offline.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.email')
2 |
3 | @section('title')
4 | {{ trans('check.job.email.offline.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('check.job.email.offline.headline') }}
9 |
10 | {{ trans('check.job.email.offline.content', array('url' => URL::route('check.show', array('id' => $id)), 'title' => $title, 'code' => $statusCode)) }}
11 | @stop
12 |
--------------------------------------------------------------------------------
/app/views/email/check/online.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.email')
2 |
3 | @section('title')
4 | {{ trans('check.job.email.online.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('check.job.email.online.headline') }}
9 |
10 | {{ trans('check.job.email.online.content', array('url' => URL::route('check.show', array('id' => $id)), 'title' => $title)) }}
11 | @stop
12 |
--------------------------------------------------------------------------------
/app/views/home/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('home.index.title') }}
5 | @stop
6 |
7 | @section('content')
8 |
24 | @stop
--------------------------------------------------------------------------------
/app/views/layouts/email.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | @yield('title')
7 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 | @yield('content')
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
224 |
225 |
226 |
--------------------------------------------------------------------------------
/app/views/layouts/master.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | @yield('title') | Ping
6 |
7 |
8 |
9 |
10 | @yield('head')
11 |
12 |
13 |
14 | @yield('sidebar')
15 |
16 |
17 |
18 |
27 |
28 |
29 | @if (!$guest)
30 |
34 | @endif
35 |
36 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | @if (isset($session['warning']))
52 |
53 | ×
54 | {{ $session['warning'] }}
55 |
56 | @endif
57 |
58 | @if (isset($session['error']))
59 |
60 | ×
61 | {{ $session['error'] }}
62 |
63 | @endif
64 |
65 | @if (isset($session['info']))
66 |
67 | ×
68 | {{ $session['info'] }}
69 |
70 | @endif
71 |
72 | @if (isset($session['success']))
73 |
74 | ×
75 | {{ $session['success'] }}
76 |
77 | @endif
78 |
79 |
80 |
81 | @yield('content')
82 |
83 |
84 |
87 |
88 |
89 |
90 |
91 |
92 | @yield('scripts')
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/app/views/site/en/imprint.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('content')
4 |
5 |
6 |
Impressum (Deutsch)
7 |
8 |
Angaben gemäß § 5 TMG
9 |
10 |
11 | Tim Helfensdörfer
12 | Klippe 109
13 | 42555 Velbert
14 |
15 | Telefon: 020529285977
16 | E-Mail: thelfensdrfer@gmail.com
17 |
18 |
19 |
20 |
21 |
Imprint (English)
22 |
23 |
24 | Tim Helfensdörfer
25 | Klippe 109
26 | 42555 Velbert
27 | Germany
28 |
29 | Phone: 020529285977
30 | Email: thelfensdrfer@gmail.com
31 |
32 |
33 |
34 | @stop
--------------------------------------------------------------------------------
/app/views/site/en/privacy.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('content')
4 |
5 |
6 |
Datenschutzerklärung (Deutsch)
7 |
8 |
Geltungsbereich
9 |
10 |
Diese Datenschutzerklärung klärt Nutzer über die Art, den Umfang und Zwecke der Erhebung und Verwendung personenbezogener Daten durch den verantwortlichen Anbieter Tim Helfensdörfer (thelfensdrfer@gmail.com, Klippe 109, 42555 Velbert, 02052/9285977) auf dieser Website (im folgenden “Angebot”) auf.
11 |
12 |
Die rechtlichen Grundlagen des Datenschutzes finden sich im Bundesdatenschutzgesetz (BDSG) und dem Telemediengesetz (TMG).
13 |
14 |
Zugriffsdaten/ Server-Logfiles
15 |
16 |
Der Anbieter (beziehungsweise sein Webspace-Provider) erhebt Daten über jeden Zugriff auf das Angebot (so genannte Serverlogfiles). Zu den Zugriffsdaten gehören:
17 |
18 |
Name der abgerufenen Webseite, Datei, Datum und Uhrzeit des Abrufs, übertragene Datenmenge, Meldung über erfolgreichen Abruf, Browsertyp nebst Version, das Betriebssystem des Nutzers, Referrer URL (die zuvor besuchte Seite), IP-Adresse und der anfragende Provider.
19 | Der Anbieter verwendet die Protokolldaten nur für statistische Auswertungen zum Zweck des Betriebs, der Sicherheit und der Optimierung des Angebotes. Der Anbieterbehält sich jedoch vor, die Protokolldaten nachträglich zu überprüfen, wenn aufgrund konkreter Anhaltspunkte der berechtigte Verdacht einer rechtswidrigen Nutzung besteht.
20 |
21 |
Umgang mit personenbezogenen Daten
22 |
23 |
Personenbezogene Daten sind Informationen, mit deren Hilfe eine Person bestimmbar ist, also Angaben, die zurück zu einer Person verfolgt werden können. Dazu gehören der Name, die Emailadresse oder die Telefonnummer. Aber auch Daten über Vorlieben, Hobbies, Mitgliedschaften oder welche Webseiten von jemandem angesehen wurden zählen zu personenbezogenen Daten.
24 |
25 |
Personenbezogene Daten werden von dem Anbieter nur dann erhoben, genutzt und weiter gegeben, wenn dies gesetzlich erlaubt ist oder die Nutzer in die Datenerhebung einwilligen.
26 |
27 |
Kontaktaufnahme
28 |
29 |
Bei der Kontaktaufnahme mit dem Anbieter (zum Beispiel per Kontaktformular oder E-Mail) werden die Angaben des Nutzers zwecks Bearbeitung der Anfrage sowie für den Fall, dass Anschlussfragen entstehen, gespeichert.
30 |
31 |
Einbindung von Diensten und Inhalten Dritter
32 |
33 |
Es kann vorkommen, dass innerhalb dieses Onlineangebotes Inhalte Dritter, wie zum Beispiel Videos von YouTube, Kartenmaterial von Google-Maps, RSS-Feeds oder Grafiken von anderen Webseiten eingebunden werden. Dies setzt immer voraus, dass die Anbieter dieser Inhalte (nachfolgend bezeichnet als "Dritt-Anbieter") die IP-Adresse der Nutzer wahr nehmen. Denn ohne die IP-Adresse, könnten sie die Inhalte nicht an den Browser des jeweiligen Nutzers senden. Die IP-Adresse ist damit für die Darstellung dieser Inhalte erforderlich. Wir bemühen uns nur solche Inhalte zu verwenden, deren jeweilige Anbieter die IP-Adresse lediglich zur Auslieferung der Inhalte verwenden. Jedoch haben wir keinen Einfluss darauf, falls die Dritt-Anbieter die IP-Adresse z.B. für statistische Zwecke speichern. Soweit dies uns bekannt ist, klären wir die Nutzer darüber auf.
34 |
35 |
36 |
Cookies
37 |
38 |
Cookies sind kleine Dateien, die es ermöglichen, auf dem Zugriffsgerät der Nutzer (PC, Smartphone o.ä.) spezifische, auf das Gerät bezogene Informationen zu speichern. Sie dienen zum einem der Benutzerfreundlichkeit von Webseiten und damit den Nutzern (z.B. Speicherung von Logindaten). Zum anderen dienen sie, um die statistische Daten der Webseitennutzung zu erfassen und sie zwecks Verbesserung des Angebotes analysieren zu können. Die Nutzer können auf den Einsatz der Cookies Einfluss nehmen. Die meisten Browser verfügen eine Option mit der das Speichern von Cookies eingeschränkt oder komplett verhindert wird. Allerdings wird darauf hingewiesen, dass die Nutzung und insbesondere der Nutzungskomfort ohne Cookies eingeschränkt werden.
39 |
40 |
Sie können viele Online-Anzeigen-Cookies von Unternehmen über die US-amerikanische Seite http://www.aboutads.info/choices/ oder die EU-Seite http://www.youronlinechoices.com/uk/your-ad-choices/ verwalten.
41 |
42 |
Registrierfunktion
43 |
44 |
Die im Rahmen der Registrierung eingegebenen Daten werden für die Zwecke der Nutzung des Angebotes verwendet. Die Nutzer können über angebots- oder registrierungsrelevante Informationen, wie Änderungen des Angebotsumfangs oder technische Umstände per E-Mail informiert werden. Die erhobenen Daten sind aus der Eingabemaske im Rahmen der Registrierung ersichtlich. Dazu gehören E-Mail Adresse (und weitere Eingaben auf der Registrierungsseite) und alle Daten die die Software auf dem Server gesammelt hat.
45 |
46 |
Google Analytics
47 |
48 |
Dieses Angebot benutzt Google Analytics, einen Webanalysedienst der Google Inc. („Google“). Google Analytics verwendet sog. „Cookies“, Textdateien, die auf Computer der Nutzer gespeichert werden und die eine Analyse der Benutzung der Website durch sie ermöglichen. Die durch den Cookie erzeugten Informationen über Benutzung dieser Website durch die Nutzer werden in der Regel an einen Server von Google in den USA übertragen und dort gespeichert.
49 | Im Falle der Aktivierung der IP-Anonymisierung auf dieser Webseite, wird die IP-Adresse der Nutzer von Google jedoch innerhalb von Mitgliedstaaten der Europäischen Union oder in anderen Vertragsstaaten des Abkommens über den Europäischen Wirtschaftsraum zuvor gekürzt. Nur in Ausnahmefällen wird die volle IP-Adresse an einen Server von Google in den USA übertragen und dort gekürzt. Die IP-Anonymisierung ist auf dieser Website aktiv. Im Auftrag des Betreibers dieser Website wird Google diese Informationen benutzen, um die Nutzung der Website durch die Nutzer auszuwerten, um Reports über die Websiteaktivitäten zusammenzustellen und um weitere mit der Websitenutzung und der Internetnutzung verbundene Dienstleistungen gegenüber dem Websitebetreiber zu erbringen.
50 | Die im Rahmen von Google Analytics von Ihrem Browser übermittelte IP-Adresse wird nicht mit anderen Daten von Google zusammengeführt. Die Nutzer können die Speicherung der Cookies durch eine entsprechende Einstellung Ihrer Browser-Software verhindern; Dieses Angebot weist die Nutzer jedoch darauf hin, dass Sie in diesem Fall gegebenenfalls nicht sämtliche Funktionen dieser Website vollumfänglich werden nutzen können. Die Nutzer können darüber hinaus die Erfassung der durch das Cookie erzeugten und auf ihre Nutzung der Website bezogenen Daten (inkl. Ihrer IP-Adresse) an Google sowie die Verarbeitung dieser Daten durch Google verhindern, indem sie das unter dem folgenden Link verfügbare Browser-Plugin herunterladen und installieren:
http://tools.google.com/dlpage/gaoptout?hl=de .
51 |
52 |
Alternativ zum Browser-Add-On oder innerhalb von Browsern auf mobilen Geräten, klicken Sie bitte diesen Link , um die Erfassung durch Google Analytics innerhalb dieser Website zukünftig zu verhindern. Dabei wird ein Opt-Out-Cookie auf Ihrem Gerät abgelegt. Löschen Sie Ihre Cookies, müssen Sie diesen Link erneut klicken.
53 |
54 |
55 |
Newsletter
56 |
57 |
Mit dem Newsletter informieren wir Sie über uns und unsere Angebote.
58 |
59 |
Wenn Sie den Newsletter empfangen möchten, benötigen wir von Ihnen eine valide Email-Adresse sowie Informationen, die uns die Überprüfung gestatten, dass Sie der Inhaber der angegebenen Email-Adresse sind bzw. deren Inhaber mit dem Empfang des Newsletters einverstanden ist. Weitere Daten werden nicht erhoben. Diese Daten werden nur für den Versand der Newsletter verwendet und werden nicht an Dritte weiter gegeben.
60 |
61 |
Mit der Anmeldung zum Newsletter speichern wir Ihre IP-Adresse und das Datum der Anmeldung. Diese Speicherung dient alleine dem Nachweis im Fall, dass ein Dritter eine Emailadresse missbraucht und sich ohne Wissen des Berechtigten für den Newsletterempfang anmeldet.
62 |
63 |
Ihre Einwilligung zur Speicherung der Daten, der Email-Adresse sowie deren Nutzung zum Versand des Newsletters können Sie jederzeit widerrufen. Der Widerruf kann über einen Link in den Newslettern selbst, in Ihrem Profilbereich oder per Mitteilung an die oben stehenden Kontaktmöglichkeiten erfolgen.
64 |
65 |
Widerruf, Änderungen, Berichtigungen und Aktualisierungen
66 |
67 |
Der Nutzer hat das Recht, auf Antrag unentgeltlich Auskunft zu erhalten über die personenbezogenen Daten, die über ihn gespeichert wurden. Zusätzlich hat der Nutzer das Recht auf Berichtigung unrichtiger Daten, Sperrung und Löschung seiner personenbezogenen Daten, soweit dem keine gesetzliche Aufbewahrungspflicht entgegensteht.
68 |
69 |
Die Datenschutzerklärung wurde zuletzt am 24. März 2014 bearbeitet.
70 |
71 |
Datenschutz-Muster von Rechtsanwalt Thomas Schwenke - I LAW it
72 |
73 |
74 |
75 |
Privacy (English)
76 |
77 |
This Privacy Policy governs the manner in which Tim Helfensdörfer collects, uses, maintains and discloses information collected from users (each, a "User") of the http://quptime.computersciencegenius.com/ website ("Site"). This privacy policy applies to the Site and all products and services offered by Tim Helfensdörfer.
78 |
79 |
Personal identification information
80 |
81 |
We may collect personal identification information from Users in a variety of ways, including, but not limited to, when Users visit our site, register on the site, place an order, subscribe to the newsletter, fill out a form, and in connection with other activities, services, features or resources we make available on our Site. Users may be asked for, as appropriate, name, email address. We will collect personal identification information from Users only if they voluntarily submit such information to us. Users can always refuse to supply personally identification information, except that it may prevent them from engaging in certain Site related activities.
82 |
83 |
Non-personal identification information
84 |
85 |
We may collect non-personal identification information about Users whenever they interact with our Site. Non-personal identification information may include the browser name, the type of computer and technical information about Users means of connection to our Site, such as the operating system and the Internet service providers utilized and other similar information.
86 |
87 |
Web browser cookies
88 |
89 |
Our Site may use "cookies" to enhance User experience. User's web browser places cookies on their hard drive for record-keeping purposes and sometimes to track information about them. User may choose to set their web browser to refuse cookies, or to alert you when cookies are being sent. If they do so, note that some parts of the Site may not function properly.
90 |
91 |
How we use collected information
92 |
93 |
Tim Helfensdörfer may collect and use Users personal information for the following purposes:
94 |
95 |
96 | To improve customer service
97 | Information you provide helps us respond to your customer service requests and support needs more efficiently.
98 | To improve our Site
99 | We may use feedback you provide to improve our products and services.
100 | To process payments
101 | We may use the information Users provide about themselves when placing an order only to provide service to that order. We do not share this information with outside parties except to the extent necessary to provide the service.
102 | To send periodic emails
103 | We may use the email address to send User information and updates pertaining to their order. It may also be used to respond to their inquiries, questions, and/or other requests. If User decides to opt-in to our mailing list, they will receive emails that may include company news, updates, related product or service information, etc. If at any time the User would like to unsubscribe from receiving future emails, we include detailed unsubscribe instructions at the bottom of each email or User may contact us via our Site.
104 |
105 |
106 |
How we protect your information
107 |
108 |
We adopt appropriate data collection, storage and processing practices and security measures to protect against unauthorized access, alteration, disclosure or destruction of your personal information, username, password, transaction information and data stored on our Site.
109 |
110 |
Sharing your personal information
111 |
112 |
We do not sell, trade, or rent Users personal identification information to others. We may share generic aggregated demographic information not linked to any personal identification information regarding visitors and users with our business partners, trusted affiliates and advertisers for the purposes outlined above.We may use third party service providers to help us operate our business and the Site or administer activities on our behalf, such as sending out newsletters or surveys. We may share your information with these third parties for those limited purposes provided that you have given us your permission.
113 |
114 |
Third party websites
115 |
116 |
Users may find advertising or other content on our Site that link to the sites and services of our partners, suppliers, advertisers, sponsors, licensors and other third parties. We do not control the content or links that appear on these sites and are not responsible for the practices employed by websites linked to or from our Site. In addition, these sites or services, including their content and links, may be constantly changing. These sites and services may have their own privacy policies and customer service policies. Browsing and interaction on any other website, including websites which have a link to our Site, is subject to that website's own terms and policies.
117 |
118 |
Changes to this privacy policy
119 |
120 |
Tim Helfensdörfer has the discretion to update this privacy policy at any time. When we do, we will revise the updated date at the bottom of this page. We encourage Users to frequently check this page for any changes to stay informed about how we are helping to protect the personal information we collect. You acknowledge and agree that it is your responsibility to review this privacy policy periodically and become aware of modifications.
121 |
122 |
Your acceptance of these terms
123 |
124 |
By using this Site, you signify your acceptance of this policy. If you do not agree to this policy, please do not use our Site. Your continued use of the Site following the posting of changes to this policy will be deemed your acceptance of those changes.
125 |
126 |
This document was last updated on March 24, 2014
127 |
128 |
Privacy policy created by http://www.generateprivacypolicy.com
129 |
130 |
131 | @stop
--------------------------------------------------------------------------------
/app/views/user/account.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('user.account.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('user.account.headline') }}
9 |
10 | {{ Form::model($user, array('route' => 'user.save', 'class' => 'form-horizontal')) }}
11 | {{ Form::token() }}
12 |
13 |
23 |
24 |
34 |
35 |
45 |
46 |
56 |
57 |
62 | {{ Form::close() }}
63 | @stop
--------------------------------------------------------------------------------
/app/views/user/login.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('user.login.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('user.login.headline') }}
9 |
10 | {{ Form::model(null, array('route' => 'user.do-login', 'class' => 'form-horizontal')) }}
11 | {{ Form::token() }}
12 |
13 |
23 |
24 |
34 |
35 |
42 |
43 |
48 | {{ Form::close() }}
49 | @stop
--------------------------------------------------------------------------------
/app/views/user/register.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('user.register.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('user.register.headline') }}
9 |
10 |
11 |
12 | {{ Form::model(null, array('route' => 'user.do-register')) }}
13 | {{ Form::token() }}
14 |
15 |
16 | {{ Form::label('email', trans('user.register.form.email')) }}
17 |
18 | {{ Form::text('email', null, array('class' => 'form-control')) }}
19 | @if ($errors->has('email'))
20 | {{ $errors->first('email') }}
21 | @endif
22 |
23 |
24 |
25 | {{ Form::label('password', trans('user.register.form.password')) }}
26 |
27 | {{ Form::password('password', array('class' => 'form-control')) }}
28 | @if ($errors->has('password'))
29 | {{ $errors->first('password') }}
30 | @endif
31 |
32 |
33 |
34 | {{ Form::label('password_repeat', trans('user.register.form.password_repeat')) }}
35 |
36 | {{ Form::password('password_repeat', array('class' => 'form-control')) }}
37 | @if ($errors->has('password_repeat'))
38 | {{ $errors->first('password_repeat') }}
39 | @endif
40 |
41 |
42 |
43 | {{ trans('user.register.form.submit') }}
44 |
45 | {{ Form::close() }}
46 |
47 |
48 |
55 |
56 | @stop
--------------------------------------------------------------------------------
/app/views/user/social.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.master')
2 |
3 | @section('title')
4 | {{ trans('user.social.title') }}
5 | @stop
6 |
7 | @section('content')
8 | {{ trans('user.social.headline') }}
9 |
10 |
11 | {{ trans('user.social.description') }}
12 |
13 |
14 | {{ Form::open() }}
15 | {{ Form::hidden('access_token', $token->getAccessToken()) }}
16 | {{ Form::hidden('refresh_token', $token->getRefreshToken()) }}
17 | {{ Form::hidden('end_of_life_token', $token->getEndOfLife()) }}
18 |
19 |
30 |
31 |
32 | {{ trans('user.social.submit') }}
33 |
34 | {{ Form::close() }}
35 | @stop
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | setRequestForConsoleEnvironment();
45 |
46 | $artisan = Illuminate\Console\Application::start($app);
47 |
48 | /*
49 | |--------------------------------------------------------------------------
50 | | Run The Artisan Application
51 | |--------------------------------------------------------------------------
52 | |
53 | | When we run the console application, the current CLI command will be
54 | | executed in this console and the response sent back to a terminal
55 | | or another output device for the developers. Here goes nothing!
56 | |
57 | */
58 |
59 | $status = $artisan->run();
60 |
61 | /*
62 | |--------------------------------------------------------------------------
63 | | Shutdown The Application
64 | |--------------------------------------------------------------------------
65 | |
66 | | Once Artisan has finished running. We will fire off the shutdown events
67 | | so that any final work may be done by the application before we shut
68 | | down the process. This is the last thing to happen to the request.
69 | |
70 | */
71 |
72 | $app->shutdown();
73 |
74 | exit($status);
--------------------------------------------------------------------------------
/bootstrap/autoload.php:
--------------------------------------------------------------------------------
1 | __DIR__.'/../app',
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Public Path
21 | |--------------------------------------------------------------------------
22 | |
23 | | The public path contains the assets for your web application, such as
24 | | your JavaScript and CSS files, and also contains the primary entry
25 | | point for web requests into these applications from the outside.
26 | |
27 | */
28 |
29 | 'public' => __DIR__.'/../public',
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Base Path
34 | |--------------------------------------------------------------------------
35 | |
36 | | The base path is the root of the Laravel installation. Most likely you
37 | | will not need to change this value. But, if for some wild reason it
38 | | is necessary you will do so here, just proceed with some caution.
39 | |
40 | */
41 |
42 | 'base' => __DIR__.'/..',
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Storage Path
47 | |--------------------------------------------------------------------------
48 | |
49 | | The storage path is used by Laravel to store cached Blade views, logs
50 | | and other pieces of information. You may modify the path here when
51 | | you want to change the location of this directory for your apps.
52 | |
53 | */
54 |
55 | 'storage' => __DIR__.'/../app/storage',
56 |
57 | );
58 |
--------------------------------------------------------------------------------
/bootstrap/start.php:
--------------------------------------------------------------------------------
1 | detectEnvironment(function() {
28 | if (isset($_SERVER['APPLICATION_ENV']))
29 | return $_SERVER['APPLICATION_ENV'];
30 | else
31 | return 'development';
32 | });
33 |
34 | /*
35 | |--------------------------------------------------------------------------
36 | | Bind Paths
37 | |--------------------------------------------------------------------------
38 | |
39 | | Here we are binding the paths configured in paths.php to the app. You
40 | | should not be changing these here. If you need to change these you
41 | | may do so within the paths.php file and they will be bound here.
42 | |
43 | */
44 |
45 | $app->bindInstallPaths(require __DIR__.'/paths.php');
46 |
47 | /*
48 | |--------------------------------------------------------------------------
49 | | Load The Application
50 | |--------------------------------------------------------------------------
51 | |
52 | | Here we will load this Illuminate application. We will keep this in a
53 | | separate location so we can isolate the creation of an application
54 | | from the actual running of the application with a given request.
55 | |
56 | */
57 |
58 | $framework = $app['path.base'].'/vendor/laravel/framework/src';
59 |
60 | require $framework.'/Illuminate/Foundation/start.php';
61 |
62 | /*
63 | |--------------------------------------------------------------------------
64 | | Return The Application
65 | |--------------------------------------------------------------------------
66 | |
67 | | This script returns the application instance. The instance is given to
68 | | the calling script so we can separate the building of the instances
69 | | from the actual running of the application and sending responses.
70 | |
71 | */
72 |
73 | return $app;
74 |
--------------------------------------------------------------------------------
/bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ping",
3 | "version": "0.1.0",
4 | "authors": [
5 | "Tim Helfensdörfer "
6 | ],
7 | "description": "",
8 | "main": "public/index.php",
9 | "license": "MIT",
10 | "homepage": "https://github.com/t-visualappeal/ping",
11 | "private": true,
12 | "ignore": [
13 | "**/.*",
14 | "node_modules",
15 | "bower_components",
16 | "public/js/vendor",
17 | "test",
18 | "tests"
19 | ],
20 | "dependencies": {
21 | "bootstrap": "3.0.*",
22 | "highcharts.com": "3.0.*"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "visualappeal/ping",
3 | "description": "Website uptime monitor.",
4 | "keywords": ["ping", "uptime", "monitor"],
5 | "license": "MIT",
6 | "require": {
7 | "laravel/framework": "4.2.*",
8 | "cartalyst/sentry": "2.1.*",
9 | "rmccue/requests": "1.8.*",
10 | "artdarek/oauth-4-laravel": "1.0.*"
11 | },
12 | "autoload": {
13 | "classmap": [
14 | "app/commands",
15 | "app/controllers",
16 | "app/jobs",
17 | "app/models",
18 | "app/database/migrations",
19 | "app/database/seeds",
20 | "app/tests/TestCase.php"
21 | ]
22 | },
23 | "scripts": {
24 | "post-install-cmd": [
25 | "php artisan optimize",
26 | "npm install",
27 | "./node_modules/.bin/bower install"
28 | ],
29 | "post-update-cmd": [
30 | "php artisan clear-compiled",
31 | "php artisan optimize",
32 | "npm update",
33 | "./node_modules/.bin/bower update"
34 | ],
35 | "post-create-project-cmd": [
36 | "php artisan key:generate"
37 | ]
38 | },
39 | "config": {
40 | "preferred-install": "dist"
41 | },
42 | "minimum-stability": "stable"
43 | }
44 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ping",
3 | "version": "0.1.0",
4 | "description": "Website status check",
5 | "main": "public/index.php",
6 | "scripts": {},
7 | "author": "Tim Helfensdörfer ",
8 | "license": "MIT",
9 | "dependencies": {
10 | "grunt": "0.4.*",
11 | "grunt-chmod": "1.0.*",
12 | "grunt-contrib-less": "1.0.*",
13 | "grunt-contrib-uglify": "0.7.*",
14 | "grunt-shell": "1.1.*",
15 | "bower": "1.3.*"
16 | },
17 | "private": true
18 | }
19 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | ./app/tests/
16 |
17 |
18 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
2 |
3 | Options -MultiViews
4 |
5 |
6 | RewriteEngine On
7 |
8 | # Redirect Trailing Slashes...
9 | RewriteRule ^(.*)/$ /$1 [L,R=301]
10 |
11 | # Handle Front Controller...
12 | RewriteCond %{REQUEST_FILENAME} !-d
13 | RewriteCond %{REQUEST_FILENAME} !-f
14 | RewriteRule ^ index.php [L]
15 |
16 |
--------------------------------------------------------------------------------
/public/css/.gitignore:
--------------------------------------------------------------------------------
1 | *.min.css
2 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualAppeal/ping-laravel/270bf48d9b36fa6d802daf36383c884e1c9b6b1c/public/favicon.ico
--------------------------------------------------------------------------------
/public/index.php:
--------------------------------------------------------------------------------
1 |
7 | */
8 |
9 | /*
10 | |--------------------------------------------------------------------------
11 | | Register The Auto Loader
12 | |--------------------------------------------------------------------------
13 | |
14 | | Composer provides a convenient, automatically generated class loader
15 | | for our application. We just need to utilize it! We'll require it
16 | | into the script here so that we do not have to worry about the
17 | | loading of any our classes "manually". Feels great to relax.
18 | |
19 | */
20 |
21 | require __DIR__.'/../bootstrap/autoload.php';
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Turn On The Lights
26 | |--------------------------------------------------------------------------
27 | |
28 | | We need to illuminate PHP development, so let's turn on the lights.
29 | | This bootstraps the framework and gets it ready for use, then it
30 | | will load up this application so that we can run it and send
31 | | the responses back to the browser and delight these users.
32 | |
33 | */
34 |
35 | $app = require_once __DIR__.'/../bootstrap/start.php';
36 |
37 | /*
38 | |--------------------------------------------------------------------------
39 | | Run The Application
40 | |--------------------------------------------------------------------------
41 | |
42 | | Once we have the application, we can simply call the run method,
43 | | which will execute the request and send the response back to
44 | | the client's browser allowing them to enjoy the creative
45 | | and wonderful application we have whipped up for them.
46 | |
47 | */
48 |
49 | $app->run();
50 |
--------------------------------------------------------------------------------
/public/js/.gitignore:
--------------------------------------------------------------------------------
1 | *.min.*
2 |
--------------------------------------------------------------------------------
/public/js/main.js:
--------------------------------------------------------------------------------
1 | var locale = {
2 | de: {
3 | decimalPoint: ',',
4 | months: [
5 | 'Januar',
6 | 'Feburar',
7 | 'März',
8 | 'April',
9 | 'Mai',
10 | 'Juni',
11 | 'Juli',
12 | 'August',
13 | 'September',
14 | 'Oktober',
15 | 'November',
16 | 'Dezember',
17 | ],
18 | shortMonths: [
19 | 'Jan',
20 | 'Feb',
21 | 'Mär',
22 | 'Apr',
23 | 'Mai',
24 | 'Jun',
25 | 'Jul',
26 | 'Aug',
27 | 'Sep',
28 | 'Okt',
29 | 'Nov',
30 | 'Dez',
31 | ],
32 | thousandsSep: '.',
33 | weekdays: [
34 | 'Sonntag',
35 | 'Montag',
36 | 'Dienstag',
37 | 'Mittwoch',
38 | 'Donnerstag',
39 | 'Freitag',
40 | 'Samstag'
41 | ],
42 | rangeFrom: 'Vom',
43 | rangeTo: 'Bis'
44 | },
45 | en: {
46 | decimalPoint: '.',
47 | months: [
48 | 'January',
49 | 'February',
50 | 'March',
51 | 'April',
52 | 'May',
53 | 'June',
54 | 'July',
55 | 'August',
56 | 'September',
57 | 'October',
58 | 'November',
59 | 'December'
60 | ],
61 | shortMonths: [
62 | 'Jan',
63 | 'Feb',
64 | 'Mar',
65 | 'Apr',
66 | 'May',
67 | 'Jun',
68 | 'Jul',
69 | 'Aug',
70 | 'Sep',
71 | 'Oct',
72 | 'Nov',
73 | 'Dec'
74 | ],
75 | thousandsSep: ',',
76 | weekdays: [
77 | 'Sunday',
78 | 'Monday',
79 | 'Tuesday',
80 | 'Wednesday',
81 | 'Thursday',
82 | 'Friday',
83 | 'Saturday'
84 | ],
85 | rangeFrom: 'From',
86 | rangeTo: 'To'
87 | }
88 | };
89 |
90 | var App = {
91 | locale: 'de',
92 | getLocale: function(type) {
93 | if (typeof locale[this.locale][type] != 'undefined') {
94 | return locale[this.locale][type];
95 | } else {
96 | return locale['en'][type];
97 | }
98 | },
99 | getMonthNames: function() {
100 | return this.getLocale('months');
101 | },
102 | getShortMonthNames: function() {
103 | return this.getLocale('shortMonths');
104 | },
105 | getDecimalPoint: function() {
106 | return this.getLocale('decimalPoint');
107 | },
108 | getThousandsSep: function() {
109 | return this.getLocale('thousandsSep');
110 | },
111 | getWeekdays: function() {
112 | return this.getLocale('weekdays');
113 | },
114 | getRangeSelectorFrom: function() {
115 | return this.getLocale('rangeFrom');
116 | },
117 | getRangeSelectorTo: function() {
118 | return this.getLocale('rangeTo');
119 | },
120 | };
121 |
122 | if (typeof Highcharts != 'undefined') {
123 | var highchartsOptions = {
124 | credits: {
125 | enabled: false
126 | },
127 | legend: {
128 | enabled: false
129 | },
130 | title: {
131 | text: null
132 | },
133 | colors: [
134 | '#A1CF64', // Green
135 | '#D95C5C', // Red
136 | '#6ECFF5', // Blue
137 | '#564F8A', // Purple
138 | '#F05940', // Orange
139 | '#00B5AD' // Teal
140 | ],
141 | navigator: {
142 | outlineColor: '#dddddd',
143 | outlineWidth: 1,
144 | handles: {
145 | backgroundColor: '#fff',
146 | borderColor: '#999'
147 | }
148 | },
149 | plotOptions: {
150 | area: {
151 | turboThreshold: 0
152 | }
153 | },
154 | rangeSelector: {
155 | buttonTheme: {
156 | fill: 'none',
157 | stroke: 'none',
158 | states: {
159 | hover: {
160 | fill: '#eee',
161 | stroke: 'none'
162 | },
163 | select: {
164 | fill: '#ccc',
165 | stroke: 'none',
166 | }
167 | }
168 | },
169 | inputBoxBorderColor: '#eee',
170 | inputBoxHeight: 18,
171 | inputDateFormat: '%e. %b %Y',
172 | inputEditDateFormat: '%d.%m.%Y',
173 | labelStyle: {
174 | color: '#111'
175 | }
176 | },
177 | xAxis: {
178 | lineColor: '#dddddd'
179 | },
180 | yAxis: {
181 | gridLineColor: '#dddddd'
182 | },
183 | tooltip: {
184 | shadow: false
185 | }
186 | };
187 |
188 | Highcharts.setOptions({
189 | lang: {
190 | rangeSelectorFrom: App.getRangeSelectorFrom(),
191 | rangeSelectorTo: App.getRangeSelectorTo(),
192 | months: App.getMonthNames(),
193 | shortMonths: App.getShortMonthNames(),
194 | decimalPoint: App.getDecimalPoint(),
195 | thousandsSep: App.getThousandsSep(),
196 | weekdays: App.getWeekdays()
197 | }
198 | });
199 | }
200 |
201 | $(function() {
202 | console.log('Init application...');
203 |
204 | var $checkUptimeChart = $('#chart-check-uptime');
205 | var $checkLatencyChart = $('#chart-check-latency');
206 |
207 | if ($checkUptimeChart.length) {
208 | $.getJSON($checkUptimeChart.data('url'), function(json) {
209 | $checkUptimeChart.highcharts('StockChart', $.extend(true, {}, highchartsOptions,
210 | {
211 | chart: {
212 | zoomType: 'x',
213 | type: 'area'
214 | },
215 | plotOptions: {
216 | area: {
217 | animation: false,
218 | cropThreshold: 60 * 24 * 31
219 | }
220 | },
221 | rangeSelector: {
222 | buttons: [{
223 | type: 'day',
224 | count: 1,
225 | text: '1d'
226 | },
227 | {
228 | type: 'day',
229 | count: 2,
230 | text: '2d'
231 | },
232 | {
233 | type: 'week',
234 | count: 1,
235 | text: '1w'
236 | },
237 | {
238 | type: 'month',
239 | count: 1,
240 | text: '1m'
241 | }],
242 | selected: 2
243 | },
244 | series: json,
245 | tooltip: {
246 | shared: true,
247 | followPointer: true,
248 | formatter: function() {
249 | var header = Highcharts.dateFormat('%A, %e. %b, %H:%M', this.x) + ' ';
250 | if (this.y == 1) {
251 | return header + 'Online ';
252 | } else {
253 | return header + 'Offline ';
254 | }
255 | }
256 | },
257 | xAxis: {
258 | type: 'datetime',
259 | minRange: 3600 * 1000,
260 | title: {
261 | text: null
262 | }
263 | },
264 | yAxis: {
265 | labels: {
266 | enabled: false
267 | },
268 | title: {
269 | text: null
270 | }
271 | }
272 | }
273 | ));
274 | });
275 | }
276 |
277 | if ($checkLatencyChart.length) {
278 | $.getJSON($checkLatencyChart.data('url'), function(json) {
279 | $checkLatencyChart.highcharts('StockChart', $.extend(true, {}, highchartsOptions,
280 | {
281 | chart: {
282 | zoomType: 'x',
283 | type: 'area'
284 | },
285 | plotOptions: {
286 | area: {
287 | animation: false,
288 | cropThreshold: 60 * 24 * 7
289 | }
290 | },
291 | rangeSelector: {
292 | buttons: [{
293 | type: 'day',
294 | count: 1,
295 | text: '1d'
296 | },
297 | {
298 | type: 'day',
299 | count: 2,
300 | text: '2d'
301 | },
302 | {
303 | type: 'week',
304 | count: 1,
305 | text: '1w'
306 | }],
307 | selected: 0
308 | },
309 | series: json,
310 | tooltip: {
311 | shared: true,
312 | followPointer: true,
313 | formatter: function() {
314 | return Highcharts.dateFormat('%A, %e. %b, %H:%M', this.x) + ' ' + '' + this.y + ' ' + $checkLatencyChart.data('seconds') + ' ';
315 | }
316 | },
317 | xAxis: {
318 | type: 'datetime',
319 | minRange: 3600 * 1000,
320 | title: {
321 | text: null
322 | }
323 | },
324 | yAxis: {
325 | title: {
326 | text: null
327 | }
328 | }
329 | }
330 | ));
331 | });
332 | }
333 | });
--------------------------------------------------------------------------------
/public/less/main.less:
--------------------------------------------------------------------------------
1 | body {
2 | color: #444;
3 | }
4 |
5 | header {
6 | nav.navbar {
7 | border: none;
8 | border-radius: 0;
9 | }
10 | }
11 |
12 | footer {
13 | margin-top: 20px;
14 | color: #999;
15 |
16 | a {
17 | color: #666;
18 |
19 | &:hover {
20 | color: #333;
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/public/packages/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualAppeal/ping-laravel/270bf48d9b36fa6d802daf36383c884e1c9b6b1c/public/packages/.gitkeep
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
--------------------------------------------------------------------------------
/queue.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd /var/www/computersciencegenius.com/subdomains/ping;
4 | php artisan queue:listen
5 |
--------------------------------------------------------------------------------
/server.php:
--------------------------------------------------------------------------------
1 |