mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 00:54:27 +00:00
- Better code and comments in application/libraries/SignatureLib->list
- cis/private/lehre/abgabe_lektor_details.php and cis/private/lehre/abgabe_student_details.php check if the uploaded document contains digital signares and display a phrase - Added new phrase to locale/de-AT/abgabetool.php and locale/en-US/abgabetool.php
This commit is contained in:
@@ -33,16 +33,13 @@ class SignatureLib
|
||||
*/
|
||||
public static function list($inputFileName)
|
||||
{
|
||||
// Generic error occurred
|
||||
$resultList = 'Generic error occurred';
|
||||
|
||||
try
|
||||
{
|
||||
// Get the content of the given file
|
||||
$inputFileContent = file_get_contents($inputFileName);
|
||||
if ($inputFileContent === false) // if failed
|
||||
{
|
||||
$resultList = 'An error occurred while getting the content from: '.$inputFileName;
|
||||
error_log('An error occurred while getting the content from: '.$inputFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -57,20 +54,22 @@ class SignatureLib
|
||||
}
|
||||
catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception
|
||||
{
|
||||
$resultList = $cee->getMessage();
|
||||
error_log($cee->getMessage());
|
||||
}
|
||||
catch (Exception $e) // any other exception
|
||||
{
|
||||
$resultList = $e->getMessage();
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
|
||||
// If the response is fine
|
||||
if (isset($resultPost->body) && is_object($resultPost->body) && isset($resultPost->body->retval))
|
||||
if (isset($resultPost->body) && is_object($resultPost->body)
|
||||
&& isset($resultPost->body->retval) && is_array($resultPost->body->retval))
|
||||
{
|
||||
return $resultPost->body->retval;
|
||||
}
|
||||
|
||||
return $resultList;
|
||||
// Otherwise return a null as error
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user