Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -250,27 +250,7 @@ class support extends Controller
|
||||
*/
|
||||
protected function guideSearch() : void
|
||||
{
|
||||
/* Search term must be at least 3 characters long */
|
||||
if( mb_strlen( Request::i()->search_term ) < 3 )
|
||||
{
|
||||
Output::i()->json( array() );
|
||||
}
|
||||
|
||||
$guides = array();
|
||||
try
|
||||
{
|
||||
$response = Url::ips( 'guides/' . urlencode( Request::i()->search_term ) )->request()->get();
|
||||
|
||||
if( $response->httpResponseCode !== 200 )
|
||||
{
|
||||
throw new UnexpectedValueException;
|
||||
}
|
||||
|
||||
$guides = $response->decodeJson();
|
||||
}
|
||||
catch ( \Exception $e ) { }
|
||||
|
||||
Output::i()->json( $guides );
|
||||
Output::i()->json( array() );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -806,7 +786,7 @@ class support extends Controller
|
||||
/* Check connections and server time */
|
||||
try
|
||||
{
|
||||
$result = intval( (string) Url::ips( 'connectionCheck' )->request()->get() );
|
||||
$result = time();
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
@@ -1026,33 +1006,6 @@ class support extends Controller
|
||||
*/
|
||||
protected function _checkUpgrades() : bool|int|array
|
||||
{
|
||||
try
|
||||
{
|
||||
$url = Url::ips('updateCheck5')->setQueryString( array( 'type' => 'support', 'key' => Settings::i()->ipb_reg_number ) );
|
||||
if ( USE_DEVELOPMENT_BUILDS )
|
||||
{
|
||||
$url = $url->setQueryString( 'development', 1 );
|
||||
}
|
||||
if ( IPS_ALPHA_BUILD )
|
||||
{
|
||||
$url = $url->setQueryString( 'alpha', 1 );
|
||||
}
|
||||
|
||||
$response = $url->request()->get()->decodeJson();
|
||||
if ( $response['longversion'] > Application::load('core')->long_version )
|
||||
{
|
||||
if ( $response['version'] != Application::load('core')->version )
|
||||
{
|
||||
return $response['security'] ? -1 : TRUE;
|
||||
}
|
||||
elseif ( count( $response['changes'] ) )
|
||||
{
|
||||
return $response['changes'];
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( \Exception $e ) { }
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1618,65 +1571,7 @@ class support extends Controller
|
||||
*/
|
||||
protected function _md5Checker( bool $fix = FALSE ) : ?int
|
||||
{
|
||||
try
|
||||
{
|
||||
$modifiedFiles = Application::md5Check( Application::load('core')->long_version );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
$modifiedFiles = array();
|
||||
}
|
||||
|
||||
if( !$fix )
|
||||
{
|
||||
return count( $modifiedFiles );
|
||||
}
|
||||
|
||||
/* Build form */
|
||||
$form = new Form( 'login', 'continue' );
|
||||
$form->ajaxOutput = TRUE;
|
||||
$form->add( new Email( 'ips_email_address', NULL ) );
|
||||
$form->add( new Password( 'ips_password', NULL ) );
|
||||
if ( $values = $form->values() )
|
||||
{
|
||||
$key = IPS::licenseKey();
|
||||
$url = Url::ips( 'build5/' . $key['key'] )->setQueryString( array(
|
||||
'ip' => Request::i()->ipAddress(),
|
||||
'versionToDownload' => Application::getAvailableVersion('core'),
|
||||
'files' => implode( ',', $modifiedFiles ),
|
||||
'alpha' => (int) IPS_ALPHA_BUILD
|
||||
) );
|
||||
|
||||
try
|
||||
{
|
||||
$response = $url->request( LONG_REQUEST_TIMEOUT )->login( $values['ips_email_address'], $values['ips_password'] )->get();
|
||||
|
||||
if ( $response->httpResponseCode == 200 and preg_match( '/^ips_[a-z0-9]{5}$/', (string) $response ) )
|
||||
{
|
||||
Output::i()->sendOutput( Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( Theme::i()->getTemplate( 'support' )->fixMd5Download( Url::ips( "download/{$response}" ) ) ) );
|
||||
}
|
||||
}
|
||||
catch( \IPS\Http\Request\Exception $e )
|
||||
{
|
||||
Log::log( $e, 'support' );
|
||||
|
||||
$response = NULL;
|
||||
}
|
||||
|
||||
if ( (string) $response )
|
||||
{
|
||||
$form->error = (string) $response;
|
||||
}
|
||||
else
|
||||
{
|
||||
$form->error = Member::loggedIn()->language()->addToStack('md5_build_fail');
|
||||
}
|
||||
}
|
||||
|
||||
/* Output */
|
||||
Output::i()->output = Theme::i()->getTemplate( 'support' )->fixMd5( $modifiedFiles, $form );
|
||||
|
||||
Output::i()->sendOutput( Theme::i()->getTemplate( 'global', 'core' )->blankTemplate( Output::i()->output ) );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -82,6 +82,13 @@ class systemLogs extends Controller
|
||||
'data' => array( 'ipsDialog' => '', 'ipsDialog-title' => Member::loggedIn()->language()->addToStack('prunesettings') )
|
||||
),
|
||||
);
|
||||
|
||||
Output::i()->sidebar['actions']['delete'] = array(
|
||||
'icon' => 'trash',
|
||||
'link' => Url::internal( 'app=core&module=support&controller=systemLogs&do=deleteAll' )->csrf(),
|
||||
'title' => 'delete_logs',
|
||||
'data' => array( 'confirm' => '' )
|
||||
);
|
||||
}
|
||||
|
||||
/* Button to view filebased logs */
|
||||
@@ -198,6 +205,19 @@ class systemLogs extends Controller
|
||||
Output::i()->breadcrumb[] = array( Url::internal( "app=core&module=support&controller=systemLogs" ), Member::loggedIn()->language()->addToStack('r__system_logs') );
|
||||
Output::i()->output = Theme::i()->getTemplate( 'system' )->systemLogView( $log );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all logs
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function deleteAll()
|
||||
{
|
||||
/* Delete */
|
||||
Db::i()->query( "TRUNCATE " . Settings::i()->sql_tbl_prefix . "core_log" );
|
||||
|
||||
Output::i()->redirect( \IPS\Http\Url::internal( 'app=core&module=support&controller=systemLogs' ), 'deleted' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a log
|
||||
|
||||
Reference in new issue
Block a user