Changeset bbc826abcc7088d95be9542a4a950ccba432ef69
- Timestamp:
- 01/21/12 16:18:39 (4 months ago)
- Author:
- Xemle <xemle@phtagr.org>
- Children:
- 1a41ceaa48ef54a2a73176f8a6e3e1209dee2f52
- Parents:
- a3a12d50dd0051bb0376b6e413a702bbd9924b34
- git-committer:
- Xemle <xemle@phtagr.org> / 2012-01-21T16:18:39Z+0100
- Message:
-
Migrage setup procedure to CakePHP 2.0
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
re449ecc0
|
rbbc826a
|
|
| 1 | 1 | <?php |
| 2 | | /* SVN FILE: $Id$ */ |
| 3 | 2 | /** |
| 4 | 3 | * This is core configuration file. |
| 5 | 4 | * |
| 6 | | * Use it to configure core behaviour ofCake. |
| | 5 | * Use it to configure core behaviour of Cake. |
| 7 | 6 | * |
| 8 | | * PHP versions 4 and 5 |
| | 7 | * PHP 5 |
| 9 | 8 | * |
| 10 | 9 | * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) |
| 11 | | * Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) |
| | 10 | * Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) |
| 12 | 11 | * |
| 13 | 12 | * Licensed under The MIT License |
| 14 | 13 | * Redistributions of files must retain the above copyright notice. |
| 15 | 14 | * |
| 16 | | * @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org) |
| | 15 | * @copyright Copyright 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org) |
| 17 | 16 | * @link http://cakephp.org CakePHP(tm) Project |
| 18 | | * @package cake |
| 19 | | * @subpackage cake.app.config |
| | 17 | * @package app.Config |
| 20 | 18 | * @since CakePHP(tm) v 0.2.9 |
| 21 | | * @version $Revision$ |
| 22 | | * @modifiedby $LastChangedBy$ |
| 23 | | * @lastmodified $Date$ |
| 24 | | * @license http://www.opensource.org/licenses/mit-license.php The MIT License |
| | 19 | * @license MIT License (http://www.opensource.org/licenses/mit-license.php) |
| 25 | 20 | */ |
| 26 | 21 | /** |
| 27 | 22 | * In this file you set up your database connection details. |
| 28 | 23 | * |
| 29 | | * @package cake |
| 30 | | * @subpackage cake.config |
| | 24 | * @package cake.config |
| 31 | 25 | */ |
| 32 | 26 | /** |
| … |
… |
|
| 34 | 28 | * You can specify multiple configurations for production, development and testing. |
| 35 | 29 | * |
| 36 | | * driver => The name of a supported driver; valid options are as follows: |
| 37 | | * mysql - MySQL 4 & 5, |
| 38 | | * mysqli - MySQL 4 & 5 Improved Interface (PHP5 only), |
| 39 | | * sqlite - SQLite (PHP5 only), |
| 40 | | * postgres - PostgreSQL 7 and higher, |
| 41 | | * mssql - Microsoft SQL Server 2000 and higher, |
| 42 | | * db2 - IBM DB2, Cloudscape, and Apache Derby (http://php.net/ibm-db2) |
| 43 | | * oracle - Oracle 8 and higher |
| 44 | | * firebird - Firebird/Interbase |
| 45 | | * sybase - Sybase ASE |
| 46 | | * adodb-[drivername] - ADOdb interface wrapper (see below), |
| 47 | | * odbc - ODBC DBO driver |
| | 30 | * datasource => The name of a supported datasource; valid options are as follows: |
| | 31 | * Database/Mysql - MySQL 4 & 5, |
| | 32 | * Database/Sqlite - SQLite (PHP5 only), |
| | 33 | * Database/Postgres - PostgreSQL 7 and higher, |
| | 34 | * Database/Sqlserver - Microsoft SQL Server 2005 and higher |
| 48 | 35 | * |
| 49 | | * You can add custom database drivers (or override existing drivers) by adding the |
| 50 | | * appropriate file to app/models/datasources/dbo. Drivers should be named 'dbo_x.php', |
| 51 | | * where 'x' is the name of the database. |
| | 36 | * You can add custom database datasources (or override existing datasources) by adding the |
| | 37 | * appropriate file to app/Model/Datasource/Database. Datasources should be named 'MyDatasource.php', |
| | 38 | * |
| 52 | 39 | * |
| 53 | 40 | * persistent => true / false |
| 54 | 41 | * Determines whether or not the database should use a persistent connection |
| 55 | 42 | * |
| 56 | | * connect => |
| 57 | | * ADOdb set the connect to one of these |
| 58 | | * (http://phplens.com/adodb/supported.databases.html) and |
| 59 | | * append it '|p' for persistent connection. (mssql|p for example, or just mssql for not persistent) |
| 60 | | * For all other databases, this setting is deprecated. |
| 61 | | * |
| 62 | 43 | * host => |
| 63 | | * the host you connect to the database. To add a socket or port number, use 'port' => # |
| | 44 | * the host you connect to the database. To add a socket or port number, use 'port' => # |
| 64 | 45 | * |
| 65 | 46 | * prefix => |
| … |
… |
|
| 68 | 49 | * |
| 69 | 50 | * schema => |
| 70 | | * For Postgres and DB2, specifies which schema you would like to use the tables in. Postgres defaults to |
| 71 | | * 'public', DB2 defaults to empty. |
| | 51 | * For Postgres specifies which schema you would like to use the tables in. Postgres defaults to 'public'. |
| 72 | 52 | * |
| 73 | 53 | * encoding => |
| 74 | | * For MySQL, MySQLi, Postgres and DB2, specifies the character encoding to use when connecting to the |
| 75 | | * database. Uses database default. |
| | 54 | * For MySQL, Postgres specifies the character encoding to use when connecting to the |
| | 55 | * database. Uses database default not specified. |
| 76 | 56 | * |
| | 57 | * unix_socket => |
| | 58 | * For MySQL to connect via socket specify the `unix_socket` parameter instead of `host` and `port` |
| 77 | 59 | */ |
| 78 | 60 | class DATABASE_CONFIG { |
| 79 | 61 | |
| 80 | | var $default = array( |
| 81 | | 'driver' => 'mysql', |
| | 62 | public $default = array( |
| | 63 | 'datasource' => 'Database/Mysql', |
| 82 | 64 | 'persistent' => false, |
| 83 | 65 | 'host' => 'localhost', |
| … |
… |
|
| 86 | 68 | 'database' => 'database_name', |
| 87 | 69 | 'prefix' => '', |
| | 70 | 'encoding' => 'utf8', |
| 88 | 71 | ); |
| 89 | 72 | |
| 90 | | var $test = array( |
| 91 | | 'driver' => 'mysql', |
| | 73 | public $test = array( |
| | 74 | 'datasource' => 'Database/Mysql', |
| 92 | 75 | 'persistent' => false, |
| 93 | 76 | 'host' => 'localhost', |
| … |
… |
|
| 96 | 79 | 'database' => 'test_database_name', |
| 97 | 80 | 'prefix' => '', |
| | 81 | 'encoding' => 'utf8', |
| 98 | 82 | ); |
| 99 | 83 | } |
| 100 | | ?> |
-
|
r3605ef4
|
rbbc826a
|
|
| 65 | 65 | |
| 66 | 66 | function isConnected() { |
| 67 | | if (!empty($this->db) && $this->db->connected) { |
| | 67 | if (!empty($this->db) && $this->db->enabled()) { |
| 68 | 68 | return true; |
| 69 | 69 | } else { |
-
|
r3605ef4
|
rbbc826a
|
|
| 22 | 22 | */ |
| 23 | 23 | |
| | 24 | App::uses('File', 'Utility'); |
| 24 | 25 | |
| 25 | 26 | class SetupController extends AppController { |
| … |
… |
|
| 91 | 92 | } |
| 92 | 93 | |
| 93 | | if (!App::import('model', $model)) { |
| | 94 | if (!App::import('Model', $model)) { |
| 94 | 95 | Logger::err("Could not load model '$model'"); |
| 95 | 96 | $success = false; |
| … |
… |
|
| 222 | 223 | |
| 223 | 224 | Logger::debug("Check for admin account"); |
| 224 | | if (!$this->__loadModel('User')) { |
| | 225 | if (!$this->__loadModel(array('User', 'Option'))) { |
| 225 | 226 | $this->checks['hasSysOp'] = false; |
| 226 | 227 | return false; |
| … |
… |
|
| 397 | 398 | $output = "<?php |
| 398 | 399 | /** |
| 399 | | * Automatic generated database configuration file by phTagr |
| | 400 | * Automatic generated database configuration file by phTagr setup |
| 400 | 401 | * |
| 401 | | * Date: ".date("Y-m-d H:i:s")." |
| | 402 | * Creation date: ".date("Y-m-d H:i:s")." |
| 402 | 403 | */ |
| 403 | | class DATABASE_CONFIG |
| 404 | | { |
| 405 | | var \$default = array('driver' => 'mysql', |
| 406 | | 'connect' => 'mysql_connect', |
| 407 | | 'persistent' => true, |
| 408 | | 'host' => '{$this->data['db']['host']}', |
| 409 | | 'login' => '{$this->data['db']['login']}', |
| 410 | | 'password' => '{$this->data['db']['password']}', |
| 411 | | 'database' => '{$this->data['db']['database']}', |
| 412 | | 'encoding' => 'utf8', |
| 413 | | 'prefix' => '{$this->data['db']['prefix']}'); |
| | 404 | class DATABASE_CONFIG { |
| | 405 | |
| | 406 | public \$default = array( |
| | 407 | 'datasource' => 'Database/Mysql', |
| | 408 | 'persistent' => true, |
| | 409 | 'host' => '{$this->data['db']['host']}', |
| | 410 | 'login' => '{$this->data['db']['login']}', |
| | 411 | 'password' => '{$this->data['db']['password']}', |
| | 412 | 'database' => '{$this->data['db']['database']}', |
| | 413 | 'prefix' => '{$this->data['db']['prefix']}', |
| | 414 | 'encoding' => 'utf8' |
| | 415 | ); |
| 414 | 416 | } |
| 415 | | ?>"; |
| | 417 | "; |
| 416 | 418 | $file =& new File($this->dbConfig, true, 644); |
| 417 | 419 | if ($file->write($output)) { |
| … |
… |
|
| 428 | 430 | } else { |
| 429 | 431 | if ($this->Session->check('configData')) { |
| 430 | | $this->data = $this->Session->read('configData'); |
| | 432 | $this->request->data = $this->Session->read('configData'); |
| 431 | 433 | } else { |
| 432 | | $this->data['db']['host'] = 'localhost'; |
| 433 | | $this->data['db']['database'] = 'phtagr'; |
| 434 | | $this->data['db']['login'] = 'phtagr'; |
| | 434 | $this->request->data('db.host', 'localhost'); |
| | 435 | $this->request->data('db.database', 'phtagr'); |
| | 436 | $this->request->data('db.login', 'phtagr'); |
| 435 | 437 | } |
| 436 | 438 | } |
| … |
… |
|
| 501 | 503 | $this->__checkSession(); |
| 502 | 504 | |
| 503 | | if (!empty($this->data)) { |
| 504 | | $this->data['User']['role'] = ROLE_ADMIN; |
| 505 | | $this->data['User']['quota'] = '100 MB'; |
| 506 | | $this->User->create($this->data); |
| 507 | | if (empty($this->data['User']['confirm'])) { |
| | 505 | if (!empty($this->request->data)) { |
| | 506 | $this->request->data['User']['role'] = ROLE_ADMIN; |
| | 507 | $this->request->data['User']['quota'] = '100 MB'; |
| | 508 | $this->User->create($this->request->data); |
| | 509 | if (empty($this->request->data['User']['confirm'])) { |
| 508 | 510 | $this->User->invalidate('confirm', 'Password confirmation is missing'); |
| 509 | 511 | } |
| … |
… |
|
| 512 | 514 | $this->Session->write('User.id', $userId); |
| 513 | 515 | $this->Session->write('User.role', ROLE_ADMIN); |
| 514 | | $this->Session->write('User.username', $this->data['User']['username']); |
| 515 | | Logger::info("Admin account '{$this->data['User']['username']}' was created"); |
| | 516 | $this->Session->write('User.username', $this->request->data['User']['username']); |
| | 517 | Logger::info("Admin account '{$this->request->data['User']['username']}' was created"); |
| 516 | 518 | $this->Session->setFlash(__("Admin account was successfully created", true)); |
| 517 | 519 | $this->redirect('system'); |
| 518 | 520 | } else { |
| 519 | | Logger::err("Admin account '{$this->data['User']['username']}' could not be created"); |
| | 521 | Logger::err("Admin account '{$this->request->data['User']['username']}' could not be created"); |
| 520 | 522 | $this->Session->setFlash(__("Could not create admin account. Please retry", true)); |
| 521 | 523 | } |
| 522 | | } elseif (!isset($this->data['User']['username'])) { |
| 523 | | $this->data['User']['username'] = 'admin'; |
| | 524 | } elseif (!isset($this->request->data['User']['username'])) { |
| | 525 | $this->request->data['User']['username'] = 'admin'; |
| 524 | 526 | } |
| 525 | 527 | Logger::info("Request account data for the admin"); |
| … |
… |
|
| 572 | 574 | $this->redirect('/'); |
| 573 | 575 | } |
| | 576 | if (!isset($this->Option->User)) { |
| | 577 | Logger::warn("Could not associate User model to Option model"); |
| | 578 | } |
| 574 | 579 | |
| 575 | 580 | Logger::info("Check for required external programs"); |
| 576 | 581 | $missing = array(); |
| 577 | | if (!empty($this->data)) { |
| | 582 | if (!empty($this->request->data)) { |
| 578 | 583 | foreach ($this->commands as $command) { |
| 579 | | $bin = Set::extract($this->data, 'bin.'.$command); |
| | 584 | $bin = Set::extract($this->request->data, 'bin.'.$command); |
| 580 | 585 | $file = new File($bin); |
| 581 | 586 | if ($file->executable()) { |
| … |
… |
|
| 591 | 596 | foreach ($this->commands as $command) { |
| 592 | 597 | $bin = $this->__findCommand($command); |
| 593 | | $this->data['bin'][$command] = $bin; |
| | 598 | $this->request->data['bin'][$command] = $bin; |
| 594 | 599 | if (!$bin) { |
| 595 | 600 | $missing[] = $command; |
| … |
… |
|
| 597 | 602 | } |
| 598 | 603 | } |
| 599 | | if (isset($this->data['bin']['ffmpeg'])) { |
| 600 | | $this->set('mp3Support', $this->__checkMp3Support($this->data['bin']['ffmpeg'])); |
| | 604 | if (isset($this->request->data['bin']['ffmpeg'])) { |
| | 605 | $this->set('mp3Support', $this->__checkMp3Support($this->request->data['bin']['ffmpeg'])); |
| 601 | 606 | } |
| 602 | 607 | $this->set('missing', $missing); |
| … |
… |
|
| 635 | 640 | return true; |
| 636 | 641 | } |
| | 642 | CakePlugin::load('Migrations'); |
| 637 | 643 | if (!App::import('Lib', 'Migrations.MigrationVersion')) { |
| 638 | 644 | Logger::err("Could not import Migrations plugin"); |
-
|
r3605ef4
|
rbbc826a
|
|
| 21 | 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 22 | 22 | */ |
| | 23 | |
| | 24 | App::uses('Model', 'Model'); |
| 23 | 25 | |
| 24 | 26 | class AppModel extends Model |
-
|
ra3a12d5
|
rbbc826a
|
|
| 32 | 32 | |
| 33 | 33 | function addDefaults($options) { |
| 34 | | $ownOptions = Set::extract($options, '{n}.name'); |
| | 34 | $ownOptions = Set::extract('/name', $options); |
| 35 | 35 | $this->unbindModel(array('belongsTo' => array('User'))); |
| 36 | 36 | $defaultOptions = $this->findAllByUserId(0); |
| … |
… |
|
| 39 | 39 | if (strlen($name) > 2 && substr($name, -2) == '[]') { |
| 40 | 40 | $options[] = $default[$this->name]; |
| 41 | | } else { |
| 42 | | $exists = in_array($name, $ownOptions); |
| 43 | | if (!$exists) { |
| 44 | | $options[] = $default[$this->name]; |
| 45 | | } |
| | 41 | } else if ($ownOptions && in_array($name, $ownOptions)) { |
| | 42 | $options[] = $default[$this->name]; |
| 46 | 43 | } |
| 47 | 44 | } |
| … |
… |
|
| 179 | 176 | $userId = $this->data['User']['id']; |
| 180 | 177 | } |
| 181 | | $data = $this->find(array('AND' => array('user_id' => $userId, 'name' => $name))); |
| | 178 | $data = $this->find('first', array('conditions' => array('Option.user_id' => $userId, 'Option.name' => $name))); |
| 182 | 179 | if ($data) { |
| 183 | 180 | $data['Option']['value'] = $value; |
-
|
r3605ef4
|
rbbc826a
|
|
| 1 | | <h1><?php __("Database upgrade"); ?></h1> |
| | 1 | <h1><?php echo __("Database upgrade"); ?></h1> |
| 2 | 2 | |
| 3 | 3 | <?php echo $this->Session->flash(); ?> |
| 4 | 4 | |
| 5 | 5 | <div class="info"> |
| 6 | | <?php __("The database schema requires an upgrade. Do you want to perform the upgrade?"); ?> |
| | 6 | <?php echo __("The database schema requires an upgrade. Do you want to perform the upgrade?"); ?> |
| 7 | 7 | </div> |
| 8 | 8 | |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("Database upgrade"); ?></h1> |
| | 1 | <h1><?php echo __("Database upgrade"); ?></h1> |
| 2 | 2 | |
| 3 | | <?php echo $session->flash(); ?> |
| | 3 | <?php echo $this->Session->flash(); ?> |
| 4 | 4 | |
| 5 | 5 | <div class="info"> |
| 6 | | <?php __("Your database is up-to-date."); ?> |
| | 6 | <?php echo __("Your database is up-to-date."); ?> |
| 7 | 7 | </div> |
| 8 | 8 | |
| 9 | | <?php echo $html->link(__("Continue", true), '/'); |
| | 9 | <?php echo $this->Html->link(__("Continue", true), '/'); |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("Database connection"); ?></h1> |
| | 1 | <h1><?php echo __("Database connection"); ?></h1> |
| 2 | 2 | |
| 3 | | <?php echo $session->flash(); ?> |
| | 3 | <?php echo $this->Session->flash(); ?> |
| 4 | 4 | |
| 5 | | <p><?php __("This step creates the configuration for the database connection. Please add your database connection settings here."); ?></p> |
| | 5 | <p><?php echo __("This step creates the configuration for the database connection. Please add your database connection settings here."); ?></p> |
| 6 | 6 | |
| 7 | | <?php echo $form->create(null, array('action' => 'config')); ?> |
| | 7 | <?php echo $this->Form->create(null, array('action' => 'config')); ?> |
| 8 | 8 | |
| 9 | | <fieldset><legend><?php __("Database"); ?></legend> |
| | 9 | <fieldset><legend><?php echo __("Database"); ?></legend> |
| 10 | 10 | <?php |
| 11 | | echo $form->input('db.host', array('label' => __('Host', true))); |
| 12 | | echo $form->input('db.database', array('label' => __('Database', true))); |
| 13 | | echo $form->input('db.login', array('label' => __('Username', true))); |
| 14 | | echo $form->input('db.password', array('label' => __('Password', true), 'type' => 'password')); |
| 15 | | echo $form->input('db.prefix', array('label' => __('Prefix', true))); |
| | 11 | echo $this->Form->input('db.host', array('label' => __('Host', true))); |
| | 12 | echo $this->Form->input('db.database', array('label' => __('Database', true))); |
| | 13 | echo $this->Form->input('db.login', array('label' => __('Username', true))); |
| | 14 | echo $this->Form->input('db.password', array('label' => __('Password', true), 'type' => 'password')); |
| | 15 | echo $this->Form->input('db.prefix', array('label' => __('Prefix', true))); |
| 16 | 16 | ?> |
| 17 | 17 | </fieldset> |
| 18 | | <?php echo $form->submit(__('Continue', true)); ?> |
| | 18 | <?php echo $this->Form->submit(__('Continue', true)); ?> |
| 19 | 19 | </form> |
| 20 | 20 | <?php |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("Database connection"); ?></h1> |
| | 1 | <h1><?php echo __("Database connection"); ?></h1> |
| 2 | 2 | |
| 3 | | <?php echo $session->flash(); ?> |
| | 3 | <?php echo $this->Session->flash(); ?> |
| 4 | 4 | |
| 5 | 5 | <div class="warning"> |
| 6 | | <?php __("The configuration file for the database connection could not be written. Please create a database configuration file by your own!"); ?> |
| | 6 | <?php echo __("The configuration file for the database connection could not be written. Please create a database configuration file by your own!"); ?> |
| 7 | 7 | </div> |
| 8 | 8 | |
| 9 | | <p><?php __("Below a sample configuration file is shown. Please adapt your database credentials and continue."); ?></p> |
| | 9 | <p><?php echo __("Below a sample configuration file is shown. Please adapt your database credentials and continue."); ?></p> |
| 10 | 10 | |
| 11 | 11 | <p><pre><?php echo $dbConfig; ?></pre></p> |
| … |
… |
|
| 28 | 28 | ?></code></pre></p> |
| 29 | 29 | |
| 30 | | <?php echo $html->link(__('Continue', true), 'configro', array('class' => 'button')); ?> |
| | 30 | <?php echo $this->Html->link(__('Continue', true), 'configro', array('class' => 'button')); ?> |
| 31 | 31 | |
| 32 | 32 | <?php |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("Initialize Database"); ?></h1> |
| | 1 | <h1><?php echo __("Initialize Database"); ?></h1> |
| 2 | 2 | |
| 3 | | <div class="info"><?php __("All tables are now initialized"); ?></div> |
| | 3 | <div class="info"><?php echo __("All tables are now initialized"); ?></div> |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("Setup Complete"); ?></h1> |
| | 1 | <h1><?php echo __("Setup Complete"); ?></h1> |
| 2 | 2 | |
| 3 | 3 | <div class="info"> |
| 4 | | <?php __("Congratulations! Your configuration of phTagr is completed. Have fun using phTagr!"); ?> |
| | 4 | <?php echo __("Congratulations! Your configuration of phTagr is completed. Have fun using phTagr!"); ?> |
| 5 | 5 | </div> |
| 6 | 6 | |
| 7 | | <p><?php printf(__("Click %s to go to home or %s your first media.", true), $html->link(__('here', true), '/'), $html->link(__('upload', true), '/browser/quickupload')); ?></p> |
| | 7 | <p><?php echo __("Click %s to go to home or %s your first media.", $this->Html->link(__('here'), '/'), $this->Html->link(__('upload'), '/browser/quickupload')); ?></p> |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("Welcome"); ?></h1> |
| | 1 | <h1><?php echo __("Welcome"); ?></h1> |
| 2 | 2 | |
| 3 | | <?php echo $session->flash(); ?> |
| | 3 | <?php echo $this->Session->flash(); ?> |
| 4 | 4 | |
| 5 | | <p><?php __("Welcome to the installation procedure of phTagr. Following steps are required to install it:"); ?></p> |
| | 5 | <p><?php echo __("Welcome to the installation procedure of phTagr. Following steps are required to install it:"); ?></p> |
| 6 | 6 | |
| 7 | 7 | <ul> |
| 8 | | <li><?php __("Check for required paths"); ?></li> |
| 9 | | <li><?php __("Configuration of database connection"); ?></li> |
| 10 | | <li><?php __("Initialize required tables"); ?></li> |
| 11 | | <li><?php __("Create administration account"); ?></li> |
| 12 | | <li><?php __("Check required external programs"); ?></li> |
| | 8 | <li><?php echo __("Check for required paths"); ?></li> |
| | 9 | <li><?php echo __("Configuration of database connection"); ?></li> |
| | 10 | <li><?php echo __("Initialize required tables"); ?></li> |
| | 11 | <li><?php echo __("Create administration account"); ?></li> |
| | 12 | <li><?php echo __("Check required external programs"); ?></li> |
| 13 | 13 | </ul> |
| 14 | 14 | |
| 15 | | <p><?php __("Note: Cookies are required to install and run phTagr."); ?></p> |
| | 15 | <p><?php echo __("Note: Cookies are required to install and run phTagr."); ?></p> |
| 16 | 16 | |
| 17 | | <p><?php printf(__("This setup will step through the required steps. Please click %s to start the installation.", true), $html->link(__('continue', true), 'path')); ?></p> |
| | 17 | <p><?php echo __("This setup will step through the required steps. Please click %s to start the installation.", $this->Html->link(__('continue'), 'path')); ?></p> |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("Path settings"); ?></h1> |
| | 1 | <h1><?php echo __("Path settings"); ?></h1> |
| 2 | 2 | |
| 3 | | <?php echo $session->flash(); ?> |
| | 3 | <?php echo $this->Session->flash(); ?> |
| 4 | 4 | |
| 5 | 5 | <?php if (count($missing)): ?> |
| 6 | 6 | <div class="error"> |
| 7 | | <?php __("Following paths are missing. Please create these paths!"); ?> |
| | 7 | <?php echo __("Following paths are missing. Please create these paths!"); ?> |
| 8 | 8 | </div> |
| 9 | 9 | |
| … |
… |
|
| 17 | 17 | <?php if (count($readonly)): ?> |
| 18 | 18 | <div class="error"> |
| 19 | | <?php __("Following paths are not writeable. Please change the permissions!"); ?> |
| | 19 | <?php echo __("Following paths are not writeable. Please change the permissions!"); ?> |
| 20 | 20 | </div> |
| 21 | 21 | |
| … |
… |
|
| 27 | 27 | <?php endif; ?> |
| 28 | 28 | |
| 29 | | <?php echo $html->link(__('Retry', true), 'path', array('class' => 'button')); ?> |
| | 29 | <?php echo $this->Html->link(__('Retry', true), 'path', array('class' => 'button')); ?> |
| 30 | 30 | <?php |
| 31 | 31 | $script = <<<'JS' |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("Security settings"); ?></h1> |
| | 1 | <h1><?php echo __("Security settings"); ?></h1> |
| 2 | 2 | |
| 3 | | <?php echo $session->flash(); ?> |
| | 3 | <?php echo $this->Session->flash(); ?> |
| 4 | 4 | |
| 5 | | <p><?php printf(__("An error occured while setting the security salt. Please have look to the log files and click on %s", true), $html->link(__('continue', true), 'salt')); ?></p> |
| | 5 | <p><?php echo __("An error occured while setting the security salt. Please have look to the log files and click on %s", $this->Html->link(__('continue'), 'salt')); ?></p> |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("Security settings"); ?></h1> |
| | 1 | <h1><?php echo __("Security settings"); ?></h1> |
| 2 | 2 | |
| 3 | | <?php echo $session->flash(); ?> |
| | 3 | <?php echo $this->Session->flash(); ?> |
| 4 | 4 | |
| 5 | | <p><?php __("phTagr could not set the security salt because the a configuration file file is write protected. Please change the configuration manually"); ?></p> |
| | 5 | <p><?php echo __("phTagr could not set the security salt because the a configuration file file is write protected. Please change the configuration manually"); ?></p> |
| 6 | 6 | |
| 7 | | <p><?php printf(__("Change the <b>Security.salt</b> setting in the core configuration file <code>%s</code> (line %d) to a random string with alpha numeric values. You can change the setting to the provided value below. After changing, click on %s.", true), h($file), $line, $html->link(__('continue', true), 'saltro')); ?><p> |
| | 7 | <p><?php echo __("Change the <b>Security.salt</b> setting in the core configuration file <code>%s</code> (line %d) to a random string with alpha numeric values. You can change the setting to the provided value below. After changing, click on %s.", h($file), $line, $this->Html->link(__('continue'), 'saltro')); ?><p> |
| 8 | 8 | |
| 9 | | <p><?php __("Current security salt value"); ?></p> |
| | 9 | <p><?php echo __("Current security salt value"); ?></p> |
| 10 | 10 | <pre>Configure::write('Security.salt', '<?php echo h($oldSalt); ?>');</pre> |
| 11 | 11 | |
| 12 | | <p><?php __("New security salt value"); ?></p> |
| | 12 | <p><?php echo __("New security salt value"); ?></p> |
| 13 | 13 | <pre>Configure::write('Security.salt', '<?php echo h($salt); ?>');</pre> |
| 14 | 14 | |
| 15 | 15 | <p></p> |
| 16 | | <?php echo $html->link(__('Continue', true), 'saltro', array('class' => 'button')); ?> |
| | 16 | <?php echo $this->Html->link(__('Continue', true), 'saltro', array('class' => 'button')); ?> |
| 17 | 17 | <?php |
| 18 | 18 | $script = <<<'JS' |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("External Programs"); ?></h1> |
| | 1 | <h1><?php echo __("External Programs"); ?></h1> |
| 2 | 2 | |
| 3 | | <?php echo $session->flash(); ?> |
| | 3 | <?php echo $this->Session->flash(); ?> |
| 4 | 4 | |
| 5 | | <p><?php __("Congratulation! phTagr just runs fine now!"); ?></p> |
| | 5 | <p><?php echo __("Congratulation! phTagr just runs fine now!"); ?></p> |
| 6 | 6 | |
| 7 | | <p><?php __("phTagr can use <u>optional</u> external programs to enlarge the functionality. exiftool is used to export the meta data to images like tags, categories or (geo) locations. ffmpeg supports other video file formats like AVI, MPEG, or MOV. And convert supports better thumbnail creation for bigger photos."); ?></p> |
| | 7 | <p><?php echo __("phTagr can use <u>optional</u> external programs to enlarge the functionality. exiftool is used to export the meta data to images like tags, categories or (geo) locations. ffmpeg supports other video file formats like AVI, MPEG, or MOV. And convert supports better thumbnail creation for bigger photos."); ?></p> |
| 8 | 8 | |
| 9 | | <p><?php __("You can set the file path of these exteranl programs here or set them later in the system preferences."); ?></p> |
| | 9 | <p><?php echo __("You can set the file path of these exteranl programs here or set them later in the system preferences."); ?></p> |
| 10 | 10 | |
| 11 | | <?php echo $html->link(__("Skip these settings", true), array("action" => "finish"), array('class' => 'button')); ?> |
| | 11 | <?php echo $this->Html->link(__("Skip these settings", true), array("action" => "finish"), array('class' => 'button')); ?> |
| 12 | 12 | |
| 13 | 13 | <?php if (count($missing)): ?> |
| 14 | 14 | <div class="info"> |
| 15 | | <?php printf(__("Following programs could not be found: %s.", true), implode(', ', $missing)); ?> |
| | 15 | <?php echo __("Following programs could not be found: %s.", implode(', ', $missing)); ?> |
| 16 | 16 | </div> |
| 17 | 17 | <?php endif; ?> |
| 18 | 18 | <?php if (isset($mp3Support) && !$mp3Support): ?> |
| 19 | 19 | <div class="warning"> |
| 20 | | <?php __("FFMPEG does not support the MP3 audio format. Sound will be disabled for videos!"); ?> |
| | 20 | <?php echo __("FFMPEG does not support the MP3 audio format. Sound will be disabled for videos!"); ?> |
| 21 | 21 | </div> |
| 22 | 22 | <?php endif; ?> |
| 23 | 23 | |
| 24 | | <?php echo $form->create(null, array('action' => 'system')); ?> |
| | 24 | <?php echo $this->Form->create(null, array('action' => 'system')); ?> |
| 25 | 25 | <fieldset> |
| 26 | 26 | <?php |
| 27 | | echo $form->input('bin.exiftool', array('label' => sprintf(__("Path to %s", true), "exiftool"))); |
| 28 | | echo $form->input('bin.convert', array('label' => sprintf(__("Path to %s", true), "convert"))); |
| 29 | | echo $form->input('bin.ffmpeg', array('label' => sprintf(__("Path to %s", true), "ffmpeg"))); |
| 30 | | echo $form->input('bin.flvtool2', array('label' => sprintf(__("Path to %s", true), "flvtool2"))); |
| | 27 | echo $this->Form->input('bin.exiftool', array('label' => __("Path to %s", "exiftool"))); |
| | 28 | echo $this->Form->input('bin.convert', array('label' => __("Path to %s", "convert"))); |
| | 29 | echo $this->Form->input('bin.ffmpeg', array('label' => __("Path to %s", "ffmpeg"))); |
| | 30 | echo $this->Form->input('bin.flvtool2', array('label' => __("Path to %s", "flvtool2"))); |
| 31 | 31 | ?> |
| 32 | 32 | </fieldset> |
| 33 | | <?php echo $form->end(__('Save', true)); ?> |
| | 33 | <?php echo $this->Form->end(__('Save', true)); ?> |
| 34 | 34 | <?php |
| 35 | 35 | $script = <<<'JS' |
-
|
ra3a12d5
|
rbbc826a
|
|
| 1 | | <h1><?php __("Create admin account"); ?></h1> |
| | 1 | <h1><?php echo __("Create admin account"); ?></h1> |
| 2 | 2 | |
| 3 | | <?php echo $session->flash(); ?> |
| | 3 | <?php echo $this->Session->flash(); ?> |
| 4 | 4 | |
| 5 | | <?php echo $form->create(null, array('action' => 'user')); ?> |
| | 5 | <?php echo $this->Form->create(null, array('action' => 'user')); ?> |
| 6 | 6 | |
| 7 | 7 | <fieldset> |
| 8 | 8 | <?php |
| 9 | | echo $form->input('User.username', array('label' => __("Username", true))); |
| 10 | | echo $form->input('User.password', array('label' => __("Password", true))); |
| 11 | | echo $form->input('User.confirm', array('label' => __("Confirm", true), 'type' => 'password')); |
| 12 | | echo $form->input('User.email', array('label' => __("Email", true))); |
| | 9 | echo $this->Form->input('User.username', array('label' => __("Username", true))); |
| | 10 | echo $this->Form->input('User.password', array('label' => __("Password", true))); |
| | 11 | echo $this->Form->input('User.confirm', array('label' => __("Confirm", true), 'type' => 'password')); |
| | 12 | echo $this->Form->input('User.email', array('label' => __("Email", true))); |
| 13 | 13 | ?> |
| 14 | 14 | </fieldset> |
| 15 | | <?php echo $form->end(__('Create', true)); ?> |
| | 15 | <?php echo $this->Form->end(__('Create', true)); ?> |
| 16 | 16 | <?php |
| 17 | 17 | $script = <<<'JS' |