$states['expected'] = 'Default socket timeout is >= 60 sec.';
370
$states[ 'result' ] = "Yours is set to " . (empty( $errors ) ? $socket_timeout . ' secs.' : '<b>< 60 sec.</b>. Please change this in your php.ini file');
374
$states['result'] = "Yours is set to " . (empty($errors) ? $socket_timeout . ' secs.' : '<b>< 60 sec.</b>. Please change this in your php.ini file');
$states[ 'result' ] = "Argument seperator is " . (empty( $errors ) ? " $arg_separator." : '<b>' . htmlspecialchars( $arg_separator ) . '</b>. Please change this in your php.ini file. This is normally done by outcommenting the line >>arg_separator.output = "' . htmlspecialchars( "&" ) . '<<');
396
$states['result'] = "Argument seperator is " . (empty($errors) ? " $arg_separator." : '<b>' . htmlspecialchars($arg_separator) . '</b>. Please change this in your php.ini file. This is normally done by outcommenting the line >>arg_separator.output = "' . htmlspecialchars("&") . '<<');
class AppController extends Controller {class AppController extends Controller {public $components = array('Auth', 'RequestHandler', 'Menu', 'MyAcl', 'Session', 'DebugKit.Toolbar');public $components = array('Auth', 'RequestHandler', 'Menu', 'MyAcl', 'Session');//, 'DebugKit.Toolbar'public $helpers = array('Html', 'Ajax', 'Javascript', 'Tree', 'Session');public $helpers = array('Html', 'Ajax', 'Javascript', 'Tree', 'Session');Configure::write('Cache.check', true);// Configure::write('Cache.check', true);'password' => 'bilboquet',class CheckerComponent extends Object {class CheckerComponent extends Object {var $components = array( 'Session', 'Script' );var $components = array('Session', 'Script');function startup( &$controller ) {function startup(&$controller) {App::import( 'Helper', 'Html' );App::import('Helper', 'Html');App::import( 'Model', 'Node' );App::import('Model', 'Node');App::import( 'Model', 'Requirement' );App::import('Model', 'Requirement');function getOnlineNodes() {function getOnlineNodes() {$nodes = $this->Node->find( 'all' );$nodes = $this->Node->find('all');$onlineNodes = array( );foreach ( $nodes as &$node ) {foreach ($nodes as &$node) {if ( $this->Node->checkJavaServer( $node[ 'Node' ][ 'nodepath' ] ) ) {if ($this->Node->checkJavaServer($node['Node']['nodepath'])) {$onlineNodes[ ] = $node;function getAllNodes() {function getAllNodes() {return $this->Node->find( 'all' );return $this->Node->find('all');function getCombinations( $requirements, $recursive = false ) {function getCombinations($requirements, $recursive = false) {$site_id = $this->Session->read( 'site_id' );$site_id = $this->Session->read('site_id');if ( !$recursive ) {if (!$recursive) {foreach ( $requirements[ 'Combination' ] as &$combination ) {foreach ($requirements['Combination'] as &$combination) {foreach ( $requirements[ 'Testcase' ] as $testcase ) {foreach ($requirements['Testcase'] as $testcase) {$combination[ 'tc' . $testcase[ 'id' ] ][ 'status' ] = $this->Requirement->Testcase->Test->getStatus( $testcase[ 'id' ], $combination[ 'Operatingsystem' ][ 'id' ], $combination[ 'Browser' ][ 'id' ], $site_id );$combination['tc' . $testcase['id']]['status'] = $this->Requirement->Testcase->Test->getStatus($testcase['id'], $combination['Operatingsystem']['id'], $combination['Browser']['id'], $site_id);$t = $this->Requirement->Testcase->Test->getLastInCombination( $testcase[ 'id' ], $combination[ 'Operatingsystem' ][ 'id' ], $combination[ 'Browser' ][ 'id' ], $site_id );$t = $this->Requirement->Testcase->Test->getLastInCombination($testcase['id'], $combination['Operatingsystem']['id'], $combination['Browser']['id'], $site_id);$combination[ 'tc' . $testcase[ 'id' ] ][ 'timestamp' ] = $t[ 'Test' ][ 'timestamp' ];$combination['tc' . $testcase['id']]['timestamp'] = $t['Test']['timestamp'];$combination[ 'tc' . $testcase[ 'id' ] ][ 'Test_id' ] = $t[ 'Test' ][ 'id' ];$combination['tc' . $testcase['id']]['Test_id'] = $t['Test']['id'];return $requirements[ 'Combination' ];return $requirements['Combination'];} else {} else {foreach ( $requirements as &$requirement ) {foreach ($requirements as &$requirement) {foreach ( $requirement[ 'Combination' ] as &$combination ) {foreach ($requirement['Combination'] as &$combination) {foreach ( $requirement[ 'Testcase' ] as $testcase ) {foreach ($requirement['Testcase'] as $testcase) {$combination[ 'tc' . $testcase[ 'id' ] ][ 'status' ] = $this->Requirement->Testcase->Test->getStatus( $testcase[ 'id' ], $combination[ 'Operatingsystem' ][ 'id' ], $combination[ 'Browser' ][ 'id' ], $site_id );$combination['tc' . $testcase['id']]['status'] = $this->Requirement->Testcase->Test->getStatus($testcase['id'], $combination['Operatingsystem']['id'], $combination['Browser']['id'], $site_id);$t = $this->Requirement->Testcase->Test->getLastInCombination( $testcase[ 'id' ], $combination[ 'Operatingsystem' ][ 'id' ], $combination[ 'Browser' ][ 'id' ], $site_id );$t = $this->Requirement->Testcase->Test->getLastInCombination($testcase['id'], $combination['Operatingsystem']['id'], $combination['Browser']['id'], $site_id);$combination[ 'tc' . $testcase[ 'id' ] ][ 'timestamp' ] = $t[ 'Test' ][ 'timestamp' ];$combination['tc' . $testcase['id']]['timestamp'] = $t['Test']['timestamp'];$combination[ 'tc' . $testcase[ 'id' ] ][ 'Test_id' ] = $t[ 'Test' ][ 'id' ];$combination['tc' . $testcase['id']]['Test_id'] = $t['Test']['id'];$combinations = array( );foreach ( $requirements as $requirement ) {foreach ($requirements as $requirement) {$combinations = array_merge( $combinations, $requirement[ 'Combination' ] );$combinations = array_merge($combinations, $requirement['Combination']);function getCombinations2( $projectId ) {function getCombinations2($projectId) {$requirements = $this->Requirement->find( 'all', array($requirements = $this->Requirement->find('all', array('conditions' => array( 'project_id' => $projectId ),'conditions' => array('project_id' => $projectId),) ) ))))$a1 = Set::extract( $requirements, "{0}.Combination" );$a1 = Set::extract($requirements, "{0}.Combination");$a2 = Set::extract( $requirements, "{1}.Combination" );$a2 = Set::extract($requirements, "{1}.Combination");if ( !empty( $a1[ 0 ] ) && !empty( $a2[ 1 ] ) ) {if (!empty($a1[0]) && !empty($a2[1])) {return array_merge( $a1[ 0 ], $a2[ 1 ] );return array_merge($a1[0], $a2[1]);} else if ( !empty( $a1[ 0 ] ) ) {} else if (!empty($a1[0])) {return $a1[ 0 ];return $a1[0];} else if ( !empty( $a2[ 1 ] ) ) {} else if (!empty($a2[1])) {return $a2[ 1 ];return $a2[1];function getOnlineCombinations( $onlineNodes ) {function getOnlineCombinations($onlineNodes) {$onlineCombinations = array( );foreach ( $onlineNodes as $onlineNode ) {foreach ($onlineNodes as $onlineNode) {foreach ( $onlineNode[ 'Browser' ] as $browser ) {foreach ($onlineNode['Browser'] as $browser) {$onlineCombinations[ ] = $onlineNode[ 'Operatingsystem' ][ 'id' ] . ',' . $browser[ 'id' ];$onlineCombinations[] = $onlineNode['Operatingsystem']['id'] . ',' . $browser['id'];function getOfflineNeeds( $onlineNodes, $combinations, $recursive = false ) {function getOfflineNeeds($onlineNodes, $combinations, $recursive = false) {$onlineCombinations = array( );$offlineNeeds = array( );$onlineCombinations = $this->getOnlineCombinations( $onlineNodes );$onlineCombinations = $this->getOnlineCombinations($onlineNodes);if ( $recursive ) {if ($recursive) {foreach ( $requirements as &$combinations ) {foreach ($requirements as &$combinations) {$requirementName = $combinations[ 'Requirement' ][ 'name' ];$requirementName = $combinations['Requirement']['name'];foreach ( $combinations[ 'Combination' ] as $combination ) {foreach ($combinations['Combination'] as $combination) {$idCombination = $combination[ 'Operatingsystem' ][ 'id' ] . ',' . $combination[ 'Browser' ][ 'id' ];$idCombination = $combination['Operatingsystem']['id'] . ',' . $combination['Browser']['id'];if ( !in_array( $idCombination, $onlineCombinations ) ) {if (!in_array($idCombination, $onlineCombinations)) {$offlineNeeds[ ] = "(Req.: $requirementName): " . $combination[ 'Browser' ][ 'name' ] . ' on ' . $combination[ 'Operatingsystem' ][ 'name' ];$offlineNeeds[] = "(Req.: $requirementName): " . $combination['Browser']['name'] . ' on ' . $combination['Operatingsystem']['name'];} else {} else {foreach ( $combinations as $combination ) {foreach ($combinations as $combination) {$idCombination = $combination[ 'Operatingsystem' ][ 'id' ] . ',' . $combination[ 'Browser' ][ 'id' ];$idCombination = $combination['Operatingsystem']['id'] . ',' . $combination['Browser']['id'];if ( !in_array( $idCombination, $onlineCombinations ) ) {if (!in_array($idCombination, $onlineCombinations)) {$offlineNeeds[ ] = $combination[ 'Browser' ][ 'name' ] . ' on ' . $combination[ 'Operatingsystem' ][ 'name' ];$offlineNeeds[] = $combination['Browser']['name'] . ' on ' . $combination['Operatingsystem']['name'];function getTestcasesWithNoScript( $project_id ) {function getTestcasesWithNoScript($project_id) {/* if ( !$recursive ) {/* if ( !$recursive ) {foreach ( $requirements[ 'Testcase' ] as $testcase ) {foreach ( $requirements[ 'Testcase' ] as $testcase ) {$noScripts = $this->Requirement->Testcase->find( 'all', array($noScripts = $this->Requirement->Testcase->find('all', array('fields' => array( 'Testcase.id', 'Testcase.name' ),'fields' => array('Testcase.id', 'Testcase.name'),'Testcase.filepath' => '' )) )))function getStateOfTheSystem() {function getStateOfTheSystem() {//if (!empty(Cache::read('stateOfTheSystem'))){$stateOfTheSystem = Cache::read('stateOfTheSystem');$stateOfTheSystem = Cache::read( 'stateOfTheSystem' );if ($this->stateOfTheSystem !== false) {//pr ($stateOfTheSystem);$this->set('states', $this->stateOfTheSystem);if ( $this->stateOfTheSystem !== false ) {$this->set( 'states', $this->stateOfTheSystem );//}$states = array('Main' => array('status' => 0));$states = array( );$states['Java'] = $this->getJavaStatus();$states[ 'Java' ] = $this->getJavaStatus();$states[ 'PHP' ] = $this->getPHPstatus();$states['PHP'] = $this->getPHPstatus();$states[ 'Magic Quotes' ] = $this->getMagicQuotesStatus();$states['Magic Quotes'] = $this->getMagicQuotesStatus();$states[ 'Max execution time' ] = $this->getMaxExecTime();$states['Max execution time'] = $this->getMaxExecTime();$states[ 'Max input time' ] = $this->getMaxInputTime();$states['Max input time'] = $this->getMaxInputTime();$states[ 'Socket timeout' ] = $this->getDefaulSocketTimeout();$states['Socket timeout'] = $this->getDefaulSocketTimeout();$states[ 'Argument separator' ] = $this->getArgumentSpearator();$states['Argument separator'] = $this->getArgumentSpearator();$states[ 'Permissions' ] = $this->getFilePermission();$states['Permissions'] = $this->getFilePermission();$states[ 'Selfcontact' ] = $this->getSelfContact();$states['Selfcontact'] = $this->getSelfContact();$states[ 'Scheduler' ] = $this->getSchedulerOnline( $states[ 'Java' ][ 'status' ] );$states['Scheduler'] = $this->getSchedulerOnline($states['Java']['status']);$states[ 'JobChecker' ] = $this->getJobCheckerOnline();$states['JobChecker'] = $this->getJobCheckerOnline();foreach ( $states as $state ) {$error=false;if ( $state[ 'status' ] == 0 ) {foreach ($states as $state) {if ($state['status'] == 0) {} else {//$this->set( 'states', $states );if($error){Cache::set( array( 'duration' => '1 hour' ) );$state['Main']['status'] = 1;if ( !$dontCache ) {Cache::write( 'stateOfTheSystem', $states );Cache::set(array('duration' => '1 hour'));if (!$dontCache) {Cache::write('stateOfTheSystem', $states);function getJavaStatus() {function getJavaStatus() {exec( 'java -version', $java_output, $java_return );exec('java -version', $java_output, $java_return);$states[ 'expected' ] = 'Java enabled system';$states['expected'] = 'Java enabled system';if ( $this->ignored == 1 ) {if ($this->ignored == 1) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';} elseif ( $java_return ) {} elseif (!$java_return) {$states[ 'status' ] = true;$states['status'] = true;$states[ 'result' ] = implode( ',', $java_output );$states['result'] = implode(',', $java_output);} else {} else {$states[ 'status' ] = false;$states['status'] = false;$states[ 'result' ] = 'Could not run java';$states['result'] = 'Could not run java';function getPHPstatus() {function getPHPstatus() {exec( 'php --version', $php_output, $php_return );exec('php --version', $php_output, $php_return);$states[ 'expected' ] = 'PHP enabled system';$states['expected'] = 'PHP enabled system';if ( $this->ignored == 1 ) {if ($this->ignored == 1) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';} elseif ( $php_return == 0 ) {} elseif ($php_return == 0) {$states[ 'status' ] = true;$states['status'] = true;$states[ 'result' ] = implode( ',', $php_output );$states['result'] = implode(',', $php_output);} else {} else {$states[ 'status' ] = false;$states['status'] = false;$states[ 'result' ] = 'Could not run php try to add it to you ENV. VAR';$states['result'] = 'Could not run php try to add it to you ENV. VAR';function getMagicQuotesStatus() {function getMagicQuotesStatus() {$states[ 'expected' ] = 'Magic qoutes turned off';$states['expected'] = 'Magic qoutes turned off';if ( $this->ignored == 1 ) {if ($this->ignored == 1) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';} elseif ( $mq_return == 0 ) {} elseif ($mq_return == 0) {$states[ 'status' ] = true;$states['status'] = true;$states[ 'result' ] = 'Yours is turned off';$states['result'] = 'Yours is turned off';} else {} else {$states[ 'status' ] = false;$states['status'] = false;$states[ 'result' ] = 'Yours is turned on';$states['result'] = 'Yours is turned on';function getMaxExecTime() {function getMaxExecTime() {$max_exec_time = ini_get( 'max_execution_time' );$max_exec_time = ini_get('max_execution_time');$states[ 'expected' ] = 'Max execution time greater than 60000 seconds';$states['expected'] = 'Max execution time greater than 60000 seconds';$states[ 'result' ] = "Yours is set to $max_exec_time";$states['result'] = "Yours is set to $max_exec_time";if ( $this->ignored == 1 ) {if ($this->ignored == 1) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';} elseif ( $max_exec_time >= 60000 || $max_exec_time == -1 ) {} elseif ($max_exec_time >= 60000 || $max_exec_time == -1) {$states[ 'status' ] = true;$states['status'] = true;} else {} else {$states[ 'status' ] = false;$states['status'] = false;function getMaxInputTime() {function getMaxInputTime() {$max_input_time = ini_get( 'max_input_time' );$max_input_time = ini_get('max_input_time');$states[ 'expected' ] = 'Max input time greater than 60000 seconds';$states['expected'] = 'Max input time greater than 60000 seconds';$states[ 'result' ] = "Yours is set to $max_input_time";$states['result'] = "Yours is set to $max_input_time";if ( $this->ignored == 1 ) {if ($this->ignored == 1) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';} elseif ( $max_input_time >= 60000 || $max_input_time == -1 ) {} elseif ($max_input_time >= 60000 || $max_input_time == -1) {$states[ 'status' ] = true;$states['status'] = true;} else {} else {$states[ 'status' ] = false;$states['status'] = false;function getDefaulSocketTimeout() {function getDefaulSocketTimeout() {$socket_timeout = ini_get( 'default_socket_timeout' );$socket_timeout = ini_get('default_socket_timeout');if ( $socket_timeout < 60 ) {if ($socket_timeout < 60) {$states[ 'expected' ] = 'Default socket timeout is >= 60 sec.';$states['expected'] = 'Default socket timeout is >= 60 sec.';$states[ 'result' ] = "Yours is set to " . (empty( $errors ) ? $socket_timeout . ' secs.' : '<b>< 60 sec.</b>. Please change this in your php.ini file');$states['result'] = "Yours is set to " . (empty($errors) ? $socket_timeout . ' secs.' : '<b>< 60 sec.</b>. Please change this in your php.ini file');if ( $this->ignored == 1 ) {if ($this->ignored == 1) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';} elseif ( empty( $errors ) ) {} elseif (empty($errors)) {$states[ 'status' ] = true;$states['status'] = true;} else {} else {$states[ 'status' ] = false;$states['status'] = false;function getArgumentSpearator() {function getArgumentSpearator() {$arg_separator = ini_get( 'arg_separator.output' );$arg_separator = ini_get('arg_separator.output');if ( $arg_separator != '&' ) {if ($arg_separator != '&') {$states[ 'expected' ] = 'Argument seperator equals \'&\'.';$states['expected'] = 'Argument seperator equals \'&\'.';$states[ 'result' ] = "Argument seperator is " . (empty( $errors ) ? " $arg_separator." : '<b>' . htmlspecialchars( $arg_separator ) . '</b>. Please change this in your php.ini file. This is normally done by outcommenting the line >>arg_separator.output = "' . htmlspecialchars( "&" ) . '<<');$states['result'] = "Argument seperator is " . (empty($errors) ? " $arg_separator." : '<b>' . htmlspecialchars($arg_separator) . '</b>. Please change this in your php.ini file. This is normally done by outcommenting the line >>arg_separator.output = "' . htmlspecialchars("&") . '<<');if ( $this->ignored == 1 ) {if ($this->ignored == 1) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';} elseif ( empty( $errors ) ) {} elseif (empty($errors)) {$states[ 'status' ] = true;$states['status'] = true;} else {} else {$states[ 'status' ] = false;$states['status'] = false;function getFilePermission() {function getFilePermission() {$dirs = array_merge( $this->directoryToArray( substr_replace( TMP, "", -1 ), true ), $this->directoryToArray( WWW_ROOT . "testscripts", true ) );$dirs = array_merge($this->directoryToArray(substr_replace(TMP, "", -1), true), $this->directoryToArray(WWW_ROOT . "testscripts", true));$states[ 'expected' ] = 'All directories writeable';$states['expected'] = 'All directories writeable';$states[ 'status' ] = true;$states['status'] = true;$states[ 'result' ] = '';$states['result'] = '';foreach ( $dirs as $dir ) {foreach ($dirs as $dir) {if ( !is_writeable( $dir ) ) {if (!is_writeable($dir)) {$states[ 'result' ] .= "<b>$dir is NOT writeable</b><br />";$states['result'] .= "<b>$dir is NOT writeable</b><br />";$states[ 'status' ] = false;$states['status'] = false;} else {} else {$states[ 'result' ] .= "$dir is writeable<br />";$states['result'] .= "$dir is writeable<br />";if ( $this->ignored == true ) {if ($this->ignored == true) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';function getSelfContact() {function getSelfContact() {$servername = $this->Session->read( '_servername_' );$servername = $this->Session->read('_servername_');$port = $this->Session->read( '_serverport_' );$port = $this->Session->read('_serverport_');$states[ 'expected' ] = 'The server could contact itself at the servername and port specified';$states['expected'] = 'The server could contact itself at the servername and port specified';$states[ 'result' ] = "Bromine tried to contact http://$servername:$port/configs/iamhere and " . ($success ? '<b>succeded.</b>' : '<b>failed. Please ' . $this->html->link( 'correct it', array( 'controller' => 'configs', 'action' => 'server' ) ) . '</b>');$states['result'] = "Bromine tried to contact http://$servername:$port/configs/iamhere and " . ($success ? '<b>succeded.</b>' : '<b>failed. Please ' . $this->html->link('correct it', array('controller' => 'configs', 'action' => 'server')) . '</b>');if ( $this->ignored == 1 ) {if ($this->ignored == 1) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';} elseif ( $success ) {} elseif ($success) {$states[ 'status' ] = true;$states['status'] = true;} else {} else {$states[ 'status' ] = false;$states['status'] = false;function getSchedulerOnline( $java ) {function getSchedulerOnline($java) {$states[ 'errors' ] = null;$states['errors'] = null;$states[ 'expected' ] = 'Scheduler is online';$states['expected'] = 'Scheduler is online';$states[ 'status' ] = false;$states['status'] = false;$states[ 'result' ] = "Java is required to run the scheduler.";$states['result'] = "Java is required to run the scheduler.";if ( $java === true ) {if ($java === true) {$states[ 'errors' ] = $this->getSchedulerStatus();$states['errors'] = $this->getSchedulerStatus();$states[ 'expected' ] = 'Scheduler is online';$states['expected'] = 'Scheduler is online';App::import( 'Helper', 'Html' );App::import('Helper', 'Html');$states[ 'result' ] = "Scheduler is " . (empty( $states[ 'Scheduler' ][ 'errors' ] ) ? 'online' : '<b>OFFLINE</b>. Please ' . $this->html->link( 'correct it', array( 'controller' => 'qrtz_job_details', 'action' => 'index' ) ));$states['result'] = "Scheduler is " . (empty($states['Scheduler']['errors']) ? 'online' : '<b>OFFLINE</b>. Please ' . $this->html->link('correct it', array('controller' => 'qrtz_job_details', 'action' => 'index')));if ( $this->ignored == 1 ) {if ($this->ignored == 1) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';} elseif ( empty( $states[ 'Scheduler' ][ 'errors' ] ) ) {} elseif (empty($states['Scheduler']['errors'])) {$states[ 'status' ] = true;$states['status'] = true;} else {} else {$states[ 'status' ] = false;$states['status'] = false;} elseif ( $java === false ) {} elseif ($java === false) {$states[ 'status' ] = false;$states['status'] = false;$states[ 'result' ] = "Java is required to run the scheduler.";$states['result'] = "Java is required to run the scheduler.";} else {} else {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = "Could not determine if the scheduler is running.";$states['result'] = "Could not determine if the scheduler is running.";function getJobCheckerOnline() {function getJobCheckerOnline() {App::import( 'Model', 'QrtzJobDetail' );App::import('Model', 'QrtzJobDetail');$job_name = $this->QrtzJobDetail->field( 'JOB_NAME', array( 'JOB_NAME' => 'JobsChecker' ) );$job_name = $this->QrtzJobDetail->field('JOB_NAME', array('JOB_NAME' => 'JobsChecker'));$success = empty( $job_name ) ? false : true;$success = empty($job_name) ? false : true;$states[ 'expected' ] = 'The scheduler has a JobsChecker job';$states['expected'] = 'The scheduler has a JobsChecker job';$states[ 'result' ] = "JobsChecker job is " . ($success ? '<b>present.</b>' : '<b>NOT present. Please ' . $this->html->link( 'correct it', array( 'controller' => 'qrtz_job_details', 'action' => 'index' ) ) . '</b>');$states['result'] = "JobsChecker job is " . ($success ? '<b>present.</b>' : '<b>NOT present. Please ' . $this->html->link('correct it', array('controller' => 'qrtz_job_details', 'action' => 'index')) . '</b>');if ( $this->ignored == 1 ) {if ($this->ignored == 1) {$states[ 'status' ] = 'ignored';$states['status'] = 'ignored';$states[ 'result' ] = ' (IGNORED!)';$states['result'] = ' (IGNORED!)';} elseif ( $success ) {} elseif ($success) {$states[ 'status' ] = true;$states['status'] = true;} else {} else {$states[ 'status' ] = false;$states['status'] = false;function getSchedulerStatus() {function getSchedulerStatus() {$dir = realpath( APP . '..' . DS . 'scheduler' );$dir = realpath(APP . '..' . DS . 'scheduler');chdir( $dir );chdir($dir);exec( $exec, $error );exec($exec, $error);private function directoryToArray( $directory, $recursive ) {private function directoryToArray($directory, $recursive) {$array_items = array( );if ( $handle = opendir( $directory ) ) {if ($handle = opendir($directory)) {while ( false !== ($file = readdir( $handle )) ) {while (false !== ($file = readdir($handle))) {if ( $file != "." && $file != ".." && $file != '.svn' ) {if ($file != "." && $file != ".." && $file != '.svn') {if ( is_dir( $directory . DS . $file ) ) {if (is_dir($directory . DS . $file)) {if ( $recursive ) {if ($recursive) {$array_items = array_merge( $array_items, $this->directoryToArray( $directory . DS . $file, $recursive ) );$array_items = array_merge($array_items, $this->directoryToArray($directory . DS . $file, $recursive));$array_items[ ] = preg_replace( "/\/\//si", DS, $file );$array_items[] = preg_replace("/\/\//si", DS, $file);} else {} else {//$array_items[] = preg_replace("/\/\//si", "/", $file);//$array_items[] = preg_replace("/\/\//si", "/", $file);closedir( $handle );closedir($handle);$this->set('states', $this->Checker->getStateOfTheSystem());$this->set('states', $this->Checker->getStateOfTheSystem());function selfcontact() {function selfcontact() {$status = Cache::read('selfcontact');$status = Cache::read('selfcontact');$servername = $this->Config->field('value', array('name' => 'servername'));$servername = $this->Config->field('value', array('name' => 'servername'));$port = $this->Config->field('value', array('name'=> 'port'));$port = $this->Config->field('value', array('name'=> 'port'));$subfolder = $this->Config->field('value', array('name'=> 'subfolder'));if(!empty($servername) && !empty($port)) {if(!empty($servername) && !empty($port)) {App::import('Core', 'HttpSocket');App::import('Core', 'HttpSocket');$HttpSocket = new HttpSocket(array('timeout' => 10));$HttpSocket = new HttpSocket(array('timeout' => 10));$result = $HttpSocket->get("http://$servername:$port/$subfolder/configs/iamhere");$result = $HttpSocket->get("http://$servername:$port/configs/iamhere");if($result == 'success') {if($result == 'success') {Cache::write('selfcontact', true);Cache::write('selfcontact', true);class ProjectsController extends AppController {class ProjectsController extends AppController {public $helpers = array( 'Html', 'Form', 'Cache', 'Xml' );public $helpers = array('Html', 'Form', 'Cache', 'Xml');public $components = array( 'Googlechart', 'Script', 'Checker' );public $components = array('Googlechart', 'Script', 'Checker');//var $cacheAction = array('testlabsview' => "1 day");//var $cacheAction = array('testlabsview' => "1 day");function index() {function index() {$this->set( 'projects', $this->paginate() );$this->set('projects', $this->paginate());function run() {function run() {$return = @$this->passedArgs[ 'return' ];$return = @$this->passedArgs['return'];$project_id = @$this->passedArgs[ 'project' ];$project_id = @$this->passedArgs['project'];if ( !file_exists( VIEWS . 'projects\\' . $return . '.ctp' ) ) {if (!file_exists(VIEWS . 'projects\\' . $return . '.ctp')) {exit( "<b>'$return'</b> return type does not have a corresponding viewer. Create $return.ctp in <b>" . VIEWS . 'projects\\' . '</b> folder' );exit("<b>'$return'</b> return type does not have a corresponding viewer. Create $return.ctp in <b>" . VIEWS . 'projects\\' . '</b> folder');if ( empty( $this->passedArgs[ 'project' ] ) || empty( $this->passedArgs[ 'site_id' ] ) ) {if (empty($this->passedArgs['project']) || empty($this->passedArgs['site_id'])) {echo('project and site_id parameters must be set');echo('project and site_id parameters must be set');Configure::write( 'debug', 0 );Configure::write('debug', 0);$this->loadModel( 'Job' );$this->loadModel('Job');$this->loadModel( 'Node' );$this->loadModel('Node');$requirements = $this->Project->Requirement->find( 'all', array($requirements = $this->Project->Requirement->find('all', array() );));$suite_id = $this->requestAction( 'runrctests/setupSuite/0' );$suite_id = $this->requestAction('runrctests/setupSuite/0');foreach ( $requirements as $requirement ) {foreach ($requirements as $requirement) {$this->requestAction( 'runrctests/runRequirement/' . $requirement[ 'Requirement' ][ 'id' ] . '/' . $suite_id );$this->requestAction('runrctests/runRequirement/' . $requirement['Requirement']['id'] . '/' . $suite_id);$jobs = $this->Job->find( 'all', array( 'conditions' => array( 'suite_id' => $suite_id ) ) );$jobs = $this->Job->find('all', array('conditions' => array('suite_id' => $suite_id)));while ( !empty( $jobs ) || !empty( $running_tests ) ) {while (!empty($jobs) || !empty($running_tests)) {$jobs = $this->Job->find( 'all', array( 'conditions' => array( 'suite_id' => $suite_id ) ) );$jobs = $this->Job->find('all', array('conditions' => array('suite_id' => $suite_id)));$running_tests = $this->Node->find( 'list', array($running_tests = $this->Node->find('list', array() );));$running_tests = array_filter( $running_tests );$running_tests = array_filter($running_tests);sleep( 10 );sleep(10);$suite = $this->Project->Suite->find( 'first', array($suite = $this->Project->Suite->find('first', array() );));$this->set( 'suite', $suite );$this->set('suite', $suite);$this->render( $return );$this->render($return);function view( $id = null ) {function view($id = null) {if ( !$id ) {if (!$id) {$this->Session->setFlash( __( 'Invalid Project.', true ) );$this->Session->setFlash(__('Invalid Project.', true));$this->redirect( array( 'action' => 'index' ) );$this->redirect(array('action' => 'index'));$project = $this->Project->find( 'first', array($project = $this->Project->find('first', array() );));$this->set( 'project', $project );$this->set('project', $project);function add() {function add() {if ( !empty( $this->data ) ) {if (!empty($this->data)) {if ( $this->Project->save( $this->data ) ) {if ($this->Project->save($this->data)) {if ( !empty( $this->data[ 'Newsites' ] ) ) {if (!empty($this->data['Newsites'])) {foreach ( $this->data[ 'Newsites' ] as $newsite ) {foreach ($this->data['Newsites'] as $newsite) {$this->Project->Site->save( array( 'Site' => array( 'name' => $newsite, 'project_id' => $this->Project->id ) ) );$this->Project->Site->save(array('Site' => array('name' => $newsite, 'project_id' => $this->Project->id)));$project_path = WWW_ROOT . DS . 'testscripts' . DS . $this->data[ 'Project' ][ 'name' ];$project_path = WWW_ROOT . DS . 'testscripts' . DS . $this->data['Project']['name'];mkdir( $project_path );mkdir($project_path);mkdir( $project_path . DS . 'php' );mkdir($project_path . DS . 'php');mkdir( $project_path . DS . 'jar' );mkdir($project_path . DS . 'jar');mkdir( $project_path . DS . 'jar' . DS . 'lib' );mkdir($project_path . DS . 'jar' . DS . 'lib');if ( $this->data[ 'Project' ][ 'copyjava' ] ) {if ($this->data['Project']['copyjava']) {if ( $handle = opendir( $path ) ) {if ($handle = opendir($path)) {while ( false !== ($file = readdir( $handle )) ) {while (false !== ($file = readdir($handle))) {if ( $file != "." && $file != ".." && $file != '.svn' ) {if ($file != "." && $file != ".." && $file != '.svn') {copy( $from, $to );copy($from, $to);closedir( $handle );closedir($handle);$this->Session->setFlash( __( 'The Project has been saved', true ) );$this->Session->setFlash(__('The Project has been saved', true));$this->redirect( array( 'action' => 'index' ) );$this->redirect(array('action' => 'index'));} else {} else {$this->Session->setFlash( __( 'The Project could not be saved. Please, try again.', true ), true, array( 'class' => 'error_message' ) );$this->Session->setFlash(__('The Project could not be saved. Please, try again.', true), true, array('class' => 'error_message'));$users = $this->Project->User->find( 'list' );$users = $this->Project->User->find('list');$this->set( compact( 'users' ) );$this->set(compact('users'));function edit( $id = null ) {function edit($id = null) {if ( !$id && empty( $this->data ) ) {if (!$id && empty($this->data)) {$this->Session->setFlash( __( 'Invalid Project', true ) );$this->Session->setFlash(__('Invalid Project', true));$this->redirect( array( 'action' => 'index' ) );$this->redirect(array('action' => 'index'));if ( !empty( $this->data ) ) {if (!empty($this->data)) {$old = $this->Project->findById( $id );$old = $this->Project->findById($id);$oldName = $old[ 'Project' ][ 'name' ];$oldName = $old['Project']['name'];$newName = $this->data[ 'Project' ][ 'name' ];$newName = $this->data['Project']['name'];if ( @rename( $project_path . $oldName, $project_path . $newName ) ) {if (@rename($project_path . $oldName, $project_path . $newName)) {if ( $this->Project->save( $this->data ) ) {if ($this->Project->save($this->data)) {if ( !empty( $this->data[ 'Sites' ] ) ) {if (!empty($this->data['Sites'])) {foreach ( $this->data[ 'Sites' ] as $id => $site ) {foreach ($this->data['Sites'] as $id => $site) {$this->Project->Site->save( array( 'Site' => array( 'id' => $id, 'name' => $site ) ) );$this->Project->Site->save(array('Site' => array('id' => $id, 'name' => $site)));if ( !empty( $this->data[ 'Newsites' ] ) ) {if (!empty($this->data['Newsites'])) {foreach ( $this->data[ 'Newsites' ] as $newsite ) {foreach ($this->data['Newsites'] as $newsite) {$this->Project->Site->save( array( 'Site' => array( 'name' => $newsite, 'project_id' => $this->data[ 'Project' ][ 'id' ] ) ) );$this->Project->Site->save(array('Site' => array('name' => $newsite, 'project_id' => $this->data['Project']['id'])));$this->Session->setFlash( __( 'The Project has been saved', true ) );$this->Session->setFlash(__('The Project has been saved', true));$this->redirect( array( 'action' => 'index' ) );$this->redirect(array('action' => 'index'));} else {} else {$this->Session->setFlash( __( 'The Project could not be saved. Please, try again.', true ), true, array( 'class' => 'error_message' ) );$this->Session->setFlash(__('The Project could not be saved. Please, try again.', true), true, array('class' => 'error_message'));} else {} else {$this->Session->setFlash( 'Could not rename ' . $project_path . $oldName . ' to ' . $project_path . $newName . '. Please, try again.', true, array( 'class' => 'error_message' ) );$this->Session->setFlash('Could not rename ' . $project_path . $oldName . ' to ' . $project_path . $newName . '. Please, try again.', true, array('class' => 'error_message'));$this->data = $this->Project->find( 'first', array($this->data = $this->Project->find('first', array() );));$users = $this->Project->User->find( 'list' );$users = $this->Project->User->find('list');$this->set( compact( 'users' ) );$this->set(compact('users'));function statistics( $send_data = false ) {function statistics($send_data = false) {//Configure::write('debug', 0);//Configure::write('debug', 0);$this->loadModel( 'Type' );$this->loadModel('Type');$types = $this->Type->find( 'all' );$types = $this->Type->find('all');$projects = $this->Project->find( 'all' );$projects = $this->Project->find('all');$result = array( );foreach ( $projects as $project ) {foreach ($projects as $project) {$project_name = $project[ 'Project' ][ 'name' ];$project_name = $project['Project']['name'];foreach ( $types as $type ) {foreach ($types as $type) {$type_name = $type[ 'Type' ][ 'extension' ];$type_name = $type['Type']['extension'];if ( is_dir( $path ) ) {if (is_dir($path)) {$dir = scandir( $path );$dir = scandir($path);foreach ( $dir as $file ) {foreach ($dir as $file) {if ( is_file( $path . $file ) ) {if (is_file($path . $file)) {$ext = substr( $file, strrpos( $file, '.' ) + 1 );$ext = substr($file, strrpos($file, '.') + 1);if ( isset( $result[ $ext ] ) ) {if (isset($result[$ext])) {$result[ $ext ]++;$result[$ext]++;} else {} else {$result[ $ext ] = 1;$result[$ext] = 1;$this->loadModel( 'Config' );$this->loadModel('Config');$key = $this->Config->findByName( 'brkey' );$key = $this->Config->findByName('brkey');if ( empty( $key ) ) {if (empty($key)) {$data[ 'Config' ] = array( 'name' => 'brkey', 'value' => md5( microtime() . rand( 0, 1000000 ) ) );$data['Config'] = array('name' => 'brkey', 'value' => md5(microtime() . rand(0, 1000000)));$this->Config->save( $data );$this->Config->save($data);$data[ 'Config' ] = array( 'name' => 'last_statistics', 'value' => 0 );$data['Config'] = array('name' => 'last_statistics', 'value' => 0);$this->Config->save( $data );$this->Config->save($data);$key = $this->Config->findByName( 'brkey' );$key = $this->Config->findByName('brkey');$key = $key[ 'Config' ][ 'value' ];$key = $key['Config']['value'];$enableGA = $this->Config->findByName( 'enableGA' );$enableGA = $this->Config->findByName('enableGA');$enableGA = $enableGA[ 'Config' ][ 'value' ];$enableGA = $enableGA['Config']['value'];$last_statistics = $this->Config->findByName( 'last_statistics' );$last_statistics = $this->Config->findByName('last_statistics');$last_statistics = $last_statistics[ 'Config' ][ 'value' ];$last_statistics = $last_statistics['Config']['value'];if ( ($enableGA == 1 && $last_statistics < strtotime( '-1 week' )) || $send_data == false ) {if (($enableGA == 1 && $last_statistics < strtotime('-1 week')) || $send_data == false) {$this->loadModel( 'Requirement' );$this->loadModel('Requirement');$this->loadModel( 'Testcase' );$this->loadModel('Testcase');$this->loadModel( 'Project' );$this->loadModel('Project');$this->loadModel( 'Site' );$this->loadModel('Site');$this->loadModel( 'User' );$this->loadModel('User');$this->loadModel( 'Node' );$this->loadModel('Node');$this->loadModel( 'Plugin' );$this->loadModel('Plugin');$this->loadModel( 'Test' );$this->loadModel('Test');$this->loadModel( 'Group' );$this->loadModel('Group');$this->loadModel( 'Testcasestep' );$this->loadModel('Testcasestep');$this->loadModel( 'Myaros_myaco' );$this->loadModel('Myaros_myaco');$this->loadModel( 'Combinations_requirement' );$this->loadModel('Combinations_requirement');$params = array( 'brkey', 'OS', 'requirements', 'testcases', 'projects', 'sites', 'users', 'nodes', 'sauce_enabled', 'plugins', 'tests', 'testcasesteps', 'groups', 'myaros_myacos', 'combinations_requirements', 'version', 'php', 'java' );$params = array('brkey', 'OS', 'requirements', 'testcases', 'projects', 'sites', 'users', 'nodes', 'sauce_enabled', 'plugins', 'tests', 'testcasesteps', 'groups', 'myaros_myacos', 'combinations_requirements', 'version', 'php', 'java');$requirements = $this->Requirement->find( 'count' );$requirements = $this->Requirement->find('count');$testcases = $this->Testcase->find( 'count' );$testcases = $this->Testcase->find('count');$projects = $this->Project->find( 'count' );$projects = $this->Project->find('count');$sites = $this->Site->find( 'count' );$sites = $this->Site->find('count');$users = $this->User->find( 'count' );$users = $this->User->find('count');$nodes = $this->Node->find( 'count' );$nodes = $this->Node->find('count');$sauce_enabled = $this->Config->findByName( 'sauce_enabled' );$sauce_enabled = $this->Config->findByName('sauce_enabled');$sauce_enabled = $sauce_enabled[ 'Config' ][ 'value' ];$sauce_enabled = $sauce_enabled['Config']['value'];$plugins = $this->Plugin->find( 'list' );$plugins = $this->Plugin->find('list');$plugins = implode( ',', $plugins );$plugins = implode(',', $plugins);$tests = $this->Test->find( 'count', array($tests = $this->Test->find('count', array('timestamp >' => date( 'Y-m-d H:i:s', $last_statistics )'timestamp >' => date('Y-m-d H:i:s', $last_statistics)) );));$testcasesteps = $this->Testcasestep->find( 'count' );$testcasesteps = $this->Testcasestep->find('count');$groups = $this->Group->find( 'count' );$groups = $this->Group->find('count');$myaros_myacos = $this->Myaros_myaco->find( 'count' );$myaros_myacos = $this->Myaros_myaco->find('count');$combinations_requirements = $this->Combinations_requirement->find( 'count' );$combinations_requirements = $this->Combinations_requirement->find('count');$version = $this->Config->findByName( 'version' );$version = $this->Config->findByName('version');$version = $version[ 'Config' ][ 'value' ];$version = $version['Config']['value'];$php = $result[ 'php' ];$php = $result['php'];$java = $result[ 'jar' ];$java = $result['jar'];foreach ( $params as $param ) {foreach ($params as $param) {$user_data[ $param ] = $$param;$user_data[$param] = $$param;if ( $send_data == true ) {if ($send_data == true) {@fopen( $url, 'r' );@fopen($url, 'r');$data = $this->Config->findByName( 'last_statistics' );$data = $this->Config->findByName('last_statistics');$data[ 'Config' ][ 'name' ] = 'last_statistics';$data['Config']['name'] = 'last_statistics';$data[ 'Config' ][ 'value' ] = strtotime( 'now' );$data['Config']['value'] = strtotime('now');$this->Config->save( $data );$this->Config->save($data);} else {} else {$this->set( 'user_data', $user_data );$this->set('user_data', $user_data);function delete( $id = null ) {function delete($id = null) {if ( !$id ) {if (!$id) {$this->Session->setFlash( __( 'Invalid id for Project', true ), true, array( 'class' => 'error_message' ) );$this->Session->setFlash(__('Invalid id for Project', true), true, array('class' => 'error_message'));$this->redirect( array( 'action' => 'index' ) );$this->redirect(array('action' => 'index'));$project = $this->Project->read( null, $id );$project = $this->Project->read(null, $id);if ( $this->Project->del( $id ) ) {if ($this->Project->del($id)) {$dir = WWW_ROOT . 'testscripts' . DS . $project[ 'Project' ][ 'name' ];$dir = WWW_ROOT . 'testscripts' . DS . $project['Project']['name'];$files = $this->directoryToArray( $dir, true );$files = $this->directoryToArray($dir, true);foreach ( $files as $file ) {foreach ($files as $file) {unlink( $file );unlink($file);rmdir( $dir . DS . 'jar' . DS . 'lib' );rmdir($dir . DS . 'jar' . DS . 'lib');rmdir( $dir . DS . 'jar' );rmdir($dir . DS . 'jar');rmdir( $dir . DS . 'php' );rmdir($dir . DS . 'php');rmdir( $dir );rmdir($dir);if ( $this->Session->read( 'project_id' ) == $id ) {if ($this->Session->read('project_id') == $id) {$this->Session->delete( 'project_id' );$this->Session->delete('project_id');$this->Session->delete( 'project_name' );$this->Session->delete('project_name');$this->Session->setFlash( __( 'Project deleted', true ) );$this->Session->setFlash(__('Project deleted', true));$this->redirect( array( 'action' => 'index' ) );$this->redirect(array('action' => 'index'));private function directoryToArray( $directory, $recursive ) {private function directoryToArray($directory, $recursive) {$array_items = array( );if ( $handle = opendir( $directory ) ) {if ($handle = opendir($directory)) {while ( false !== ($file = readdir( $handle )) ) {while (false !== ($file = readdir($handle))) {if ( $file != "." && $file != ".." && $file != '.svn' ) {if ($file != "." && $file != ".." && $file != '.svn') {if ( is_dir( $directory . "/" . $file ) ) {if (is_dir($directory . "/" . $file)) {if ( $recursive ) {if ($recursive) {$array_items = array_merge( $array_items, $this->directoryToArray( $directory . "\\" . $file, $recursive ) );$array_items = array_merge($array_items, $this->directoryToArray($directory . "\\" . $file, $recursive));//$array_items[] = preg_replace("/\/\//si", "/", $file);//$array_items[] = preg_replace("/\/\//si", "/", $file);//$array_items[] = preg_replace("/\/\//si", "", $file);//$array_items[] = preg_replace("/\/\//si", "", $file);$array_items[ ] = $file;closedir( $handle );closedir($handle);function testlabview( $id = null ) {function testlabview($id = null) {//echo date('H:i:s');//echo date('H:i:s');if ( $id == null && $this->Session->check( 'project_id' ) ) {if ($id == null && $this->Session->check('project_id')) {$id = $this->Session->read( 'project_id' );$id = $this->Session->read('project_id');$project = $this->Project->read( null, $id );$project = $this->Project->read(null, $id);$this->set( 'project', $project );$this->set('project', $project);$requirements = $this->Project->Requirement->find( 'all', array($requirements = $this->Project->Requirement->find('all', array() );));foreach ( $requirements as $requirement ) {foreach ($requirements as $requirement) {foreach ( $requirement[ 'Testcase' ] as $testcase ) {foreach ($requirement['Testcase'] as $testcase) {$status = $this->Project->Testcase->getStatus( $testcase[ 'id' ], $requirement[ 'Requirement' ][ 'id' ], $this->Session->read( 'site_id' ) );$status = $this->Project->Testcase->getStatus($testcase['id'], $requirement['Requirement']['id'], $this->Session->read('site_id'));switch ( $status ) {switch ($status) {$this->set( 'chart1', $this->Googlechart->pie( $failed, $passed, $notdone ) );$this->set('chart1', $this->Googlechart->pie($failed, $passed, $notdone));$this->set(compact('testcases','browsers','operatingsystems','days'));$this->set(compact('testcases','browsers','operatingsystems','days'));$this->loadModel( 'Requirement' );$this->loadModel('Requirement');$this->loadModel( 'Testcase' );$this->loadModel('Testcase');$nestedTestcases = $this->Testcase->find( 'count', array($nestedTestcases = $this->Testcase->find('count', array('Testcase.project_id' => $project[ 'Project' ][ 'id' ]'Testcase.project_id' => $project['Project']['id']) )))$this->loadModel( 'Requirement' );$this->loadModel('Requirement');$nestedRequirements = $this->Requirement->find( 'all', array($nestedRequirements = $this->Requirement->find('all', array() )))$nestedCombinations = $this->Checker->getCombinations2( $id );$nestedCombinations = $this->Checker->getCombinations2($id);$nestedOfflineNeeds = $this->Checker->getOfflineNeeds( $onlineNodes, $nestedRequirements, true );$nestedOfflineNeeds = $this->Checker->getOfflineNeeds($onlineNodes, $nestedRequirements, true);$nestedNoScripts = $this->Checker->getTestcasesWithNoScript( $id );$nestedNoScripts = $this->Checker->getTestcasesWithNoScript($id);$nestedOfflineNeeds = $this->Checker->getOfflineNeeds( $onlineNodes, $nestedRequirements, true );$nestedOfflineNeeds = $this->Checker->getOfflineNeeds($onlineNodes, $nestedRequirements, true);$this->set( 'noScriptsAll', (count( $nestedNoScripts ) == count( $nestedTestcases ) ) );$this->set('noScriptsAll', (count($nestedNoScripts) == count($nestedTestcases)));$this->set( 'nestedCombinations', $nestedCombinations );$this->set('nestedCombinations', $nestedCombinations);$this->set( 'nestedTestcases', $nestedTestcases );$this->set('nestedTestcases', $nestedTestcases);$this->set( 'nestedOfflineNeeds', $nestedOfflineNeeds );$this->set('nestedOfflineNeeds', $nestedOfflineNeeds);$this->set( 'nestedNoScripts', $nestedNoScripts );$this->set('nestedNoScripts', $nestedNoScripts);$this->set( 'nestedOfflineNeeds', $nestedOfflineNeeds );$this->set('nestedOfflineNeeds', $nestedOfflineNeeds);$this->set( 'onlineNodes', $onlineNodes );$this->set('onlineNodes', $onlineNodes);$this->set( 'nodes', $this->Checker->getAllNodes() );$this->set('nodes', $this->Checker->getAllNodes());$this->loadModel( 'Config' );$this->loadModel('Config');$this->set( 'servername', $this->Config->field( 'value', array( 'name' => 'servername' ) ) );$this->set('servername', $this->Config->field('value', array('name' => 'servername')));$this->set( 'port', $this->Config->field( 'value', array( 'name' => 'port' ) ) );$this->set('port', $this->Config->field('value', array('name' => 'port')));function select( $project_id = null, $noredirect = false ) {function select($project_id = null, $noredirect = false) {$this->statistics( true );$this->statistics(true);if ( empty( $project_id ) ) {if (empty($project_id)) {$project_id = $this->data[ 'Project' ][ 'project_id' ];$project_id = $this->data['Project']['project_id'];if ( $project_id ) {if ($project_id) {foreach ( $this->userprojects as $userproject ) {foreach ($this->userprojects as $userproject) {$userprojects_list[ ] = $userproject[ 'id' ];$userprojects_list[] = $userproject['id'];if ( in_array( $project_id, $userprojects_list ) ) {if (in_array($project_id, $userprojects_list)) {$project = $this->Project->findById( $project_id );$project = $this->Project->findById($project_id);if ( $this->Session->write( 'project_id', $project_id ) && $this->Session->write( 'project_name', $project[ 'Project' ][ 'name' ] ) ) {if ($this->Session->write('project_id', $project_id) && $this->Session->write('project_name', $project['Project']['name'])) {if ( $noredirect === false ) {// if ($noredirect === false) {if ( $this->referer() == '/projects/select' ) {$this->redirect('/testlabs#/projects/testlabview');$this->redirect( '/testlabs#/projects/testlabview' );// }} else {$this->redirect( $this->referer() );}}} else {} else {$this->Session->setFlash( __( 'The project session could not be set. Please, try again.', true ), true, array( 'class' => 'error_message' ) );$this->Session->setFlash(__('The project session could not be set. Please, try again.', true), true, array('class' => 'error_message'));} else {} else {$this->Session->setFlash( __( 'You do not have access to this project.', true ), true, array( 'class' => 'error_message' ) );$this->Session->setFlash(__('You do not have access to this project.', true), true, array('class' => 'error_message'));if ( !empty( $this->data ) ) {if (!empty($this->data)) {$this->Session->setFlash( __( 'No project selected. Please, try again.', true ), true, array( 'class' => 'error_message' ) );$this->Session->setFlash(__('No project selected. Please, try again.', true), true, array('class' => 'error_message'));function clearHistory( $id ) {function clearHistory($id) {$this->loadModel( 'Requirement' );$this->loadModel('Requirement');$reqs = $this->Requirement->find( 'all', array($reqs = $this->Requirement->find('all', array('contain' => array( 'Testcase' )'contain' => array('Testcase')) );));class QrtzJobDetailsController extends AppController {class QrtzJobDetailsController extends AppController {public $helpers = array( 'Html', 'Form', 'Paginator' );debug($state[ 'status' ]);if ( $state[ 'status' ] === true ) {if ( $state[ 'status' ] === true ) {if ( $selfContact[ 'status' ] === true ) {if ( $selfContact[ 'status' ] === true ) {if ( $sheduler[ 'status' ] !== "ignored" ) {if ( $sheduler[ 'status' ] !== "ignored" ) {function index() {function index() {function view($id = null) {function view($id = null) {$this->set('nestedRequirements', $nestedRequirements);$this->set('nestedRequirements', $nestedRequirements);$this->set('noScripts', $noScripts);if (!empty($noScripts)) {$this->set('noScripts', $noScripts);}if (count($requirements['Testcase']) == count($noScripts)) {if (count($requirements['Testcase']) == count($noScripts)) {$this->set('noScriptsAll', true);$this->set('noScriptsAll', true);$this->render('schedule');$this->render('schedule');function treeView(){function treeView() {//$this->Requirement->recursive = 1;$this->set('data', $this->Requirement->find('threaded',$this->set('data', $this->Requirement->find('threaded',class TestlabsController extends AppController {class TestlabsController extends AppController {public $helpers = array('Html', 'Form', 'Tree', 'Cache');public $helpers = array('Html', 'Form', 'Tree');public $uses = array('Command');public $uses = array('Command');$this->loadModel('Testcase');$this->loadModel('Testcase');Configure::write('debug',0);//Configure::write('debug', 0);$this->set('testcases', $this->Testcase->find('all', array($this->set('testcases', $this->Testcase->find('all', array('fields' => array('name')'fields' => array('name')public function treeView() {public function treeView() {'project_id' => $this->Session->read('project_id')'project_id' => $this->Session->read('project_id')))$this->set('sites', $sites);$this->set('sites', $sites);))$this->array_search_recursive('children', $requirements);$this->array_search_recursive('children', $requirements);$this->set('data', $requirements);$this->set('data', $requirements);class TypesController extends AppController {class TypesController extends AppController {public $main_menu_id = -2;function index() {function index() {$this->set('types', $this->paginate());$this->set('types', $this->paginate());