Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/v1/class/i18n/i18n.arbeit.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function loadLanguage($locale = null, $page = "index", $area = "suite"){
return [];
}

private function sanitizeOutput($data) {
public function sanitizeOutput($data) {
if (is_array($data)) {
return array_map([$this, 'sanitizeOutput'], $data);
}
Expand Down
58 changes: 29 additions & 29 deletions api/v1/class/i18n/suite/status/snippets_DE.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"worktime_deleted": "Hinweis: Arbeitszeit erfolgreich gelöscht!",
"logged_out": "Hinweis: Erfolgreich ausgeloggt!",
"error_sickness": "Fehler: Deine Krankheit konnte nicht gespeichert werden. Bitte kontaktiere deinen Administrator!",
"error_vacation": "Fehler: Deine Urlaub konnte nicht gespeichert werden. Bitte kontaktiere deinen Administrator!",
"vacation_added": "Hinweis: Dein Urlaub wurde erfolgreich gespeichert!",
"sickness_added": "Hinweis: Deine Krankheit wurde erfolgreich gespeichert!",
"notifications_entry_deleted": "Hinweis: Benachrichtigungeneintrag gelöscht!",
"noperms": "Hinweis: Fehlende Berechtigungen",
"user_deleted": "Hinweis: Benutzer erfolgreich gelöscht!",
"created_user": "Hinweis: Benutzer erfolgreich erstellt!",
"worktime_added": "Hinweis: Arbeitszeit erfolgreich hinzugefügt!",
"password_changed": "Hinweis: Dein Passwort wurde erfolgreich geändert. Bitte melde dich erneut an.",
"password_change_failed": "Fehler: Dein Passwort konnte nicht geändert werden, bitte kontaktiere den Support.",
"password_reset": "Hinweis: Es wurde eine E-Mail verschickt, damit du dein Passwort zurücksetzen kannst.",
"nodata": "Fehler: Es wurde kein Benutzername oder Passwort eingegeben.",
"wrongdata": "Fehler: Falsche Anmeldedaten.",
"worktime_review": "Hinweis: Arbeitszeit erfolgreich auf Prüfung gestellt!",
"worktime_review_unlock": "Hinweis: Prüfung erfolgreich aufgehoben für Arbeitszeit!",
"worktime_easymode_start": "Hinweis: Deine Schicht wurde erfolgreich gestartet!",
"worktime_easymode_end": "Hinweis: Deine Schicht wurde erfolgreich beendet!",
"worktime_easymode_pause_start": "Hinweis: Deine Pause wurde erfolgreich gestartet!",
"worktime_easymode_pause_end": "Hinweis: Deine Pause wurde erfolgreich beendet!",
"easymode_toggled": "Hinweis: Der Modus wurde erfolgreich gewechselt!",
"error": "Hinweis: Ein Fehler ist aufgetreten. Bitte überprüfe den Log, falls möglich.",
"statemismatch": "Fehler: Sicherheitsfehler",
"ldapauth": "Fehler: Die Authentifizierung über LDAP ist fehlgeschlagen.",
"ldapcreated": "Hinweis: Bitte melde dich erneut an. Dein Benutzerkonto wurde nun erstellt. (LDAP allowed self-login)",
"notification_not_found": "Fehler: Benachrichtigung nicht gefunden."
}
"worktime_deleted": "[BLUE]Hinweis: Arbeitszeit erfolgreich gelöscht![/BLUE]",
"logged_out": "[BLUE]Hinweis: Erfolgreich ausgeloggt![/BLUE]",
"error_sickness": "[RED]Fehler: Deine Krankheit konnte nicht gespeichert werden. Bitte kontaktiere deinen Administrator![/RED]",
"error_vacation": "[RED]Fehler: Deine Urlaub konnte nicht gespeichert werden. Bitte kontaktiere deinen Administrator![/RED]",
"vacation_added": "[GREEN]Hinweis: Dein Urlaub wurde erfolgreich gespeichert![/GREEN]",
"sickness_added": "[BLUE]Hinweis: Deine Krankheit wurde erfolgreich gespeichert![/BLUE]",
"notifications_entry_deleted": "Hinweis: Benachrichtigungeneintrag gelöscht![/BLUE]",
"noperms": "[YELLOW]Hinweis: Fehlende Berechtigungen[/YELLOW]",
"user_deleted": "[BLUE]Hinweis: Benutzer erfolgreich gelöscht![/BLUE]",
"created_user": "[GREEN]Hinweis: Benutzer erfolgreich erstellt![/GREEN]",
"worktime_added": "[GREEN]Hinweis: Arbeitszeit erfolgreich hinzugefügt![/GREEN]",
"password_changed": "[YELLOW]Hinweis: Dein Passwort wurde erfolgreich geändert. Bitte melde dich erneut an.[/YELLOW]",
"password_change_failed": "[RED]Fehler: Dein Passwort konnte nicht geändert werden, bitte kontaktiere den Support.[/RED]",
"password_reset": "[YELLOW]Hinweis: Es wurde eine E-Mail verschickt, damit du dein Passwort zurücksetzen kannst.[/YELLOW]",
"nodata": "[RED]Fehler: Es wurde kein Benutzername oder Passwort eingegeben.[/RED]",
"wrongdata": "[RED]Fehler: Falsche Anmeldedaten.[/RED]",
"worktime_review": "[GREEN]Hinweis: Arbeitszeit erfolgreich auf Prüfung gestellt![/GREEN]",
"worktime_review_unlock": "[GREEN]Hinweis: Prüfung erfolgreich aufgehoben für Arbeitszeit![/GREEN]",
"worktime_easymode_start": "[GREEN]Hinweis: Deine Schicht wurde erfolgreich gestartet![/GREEN]",
"worktime_easymode_end": "[GREEN]Hinweis: Deine Schicht wurde erfolgreich beendet![/GREEN]",
"worktime_easymode_pause_start": "[GREEN]Hinweis: Deine Pause wurde erfolgreich gestartet![/GREEN]",
"worktime_easymode_pause_end": "[GREEN]Hinweis: Deine Pause wurde erfolgreich beendet![/GREEN]",
"easymode_toggled": "[GREEN]Hinweis: Der Modus wurde erfolgreich gewechselt![GREEN]",
"error": "[RED]Hinweis: Ein Fehler ist aufgetreten. Bitte überprüfe den Log, falls möglich.[/RED]",
"statemismatch": "[RED]Fehler: Sicherheitsfehler[/RED]",
"ldapauth": "[RED]Fehler: Die Authentifizierung über LDAP ist fehlgeschlagen.[/RED]",
"ldapcreated": "[YELLOW]Hinweis: Bitte melde dich erneut an. Dein Benutzerkonto wurde nun erstellt. (LDAP allowed self-login)[/YELLOW]",
"notification_not_found": "[RED]Fehler: Benachrichtigung nicht gefunden.[/RED]"
}
59 changes: 29 additions & 30 deletions api/v1/class/i18n/suite/status/snippets_EN.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
{
"worktime_deleted": "Note: Working time successfully deleted!",
"logged_out": "Note: Logged out successfully!",
"error_sickness": "Error: Your illness could not be saved. Please contact your administrator!",
"error_vacation": "Error: Your vacation could not be saved. Please contact your administrator!",
"vacation_added": "Note: Your vacation has been successfully saved!",
"sickness_added": "Note: Your illness has been saved successfully!",
"notifications_entry_deleted": "Note: Calendar entry deleted!",
"noperms": "Note: Missing permissions",
"user_deleted": "Note: User deleted successfully!",
"created_user": "Note: User created successfully!",
"worktime_added": "Note: Working time added successfully!",
"password_changed": "Note: Your password has been changed successfully. Please log in again.",
"password_change_failed": "Error: Your password could not be changed, please contact support.",
"password_reset": "Note: An email has been sent with instructions to reset your password.",
"nodata": "Error: No username or password was entered.",
"wrongdata": "Error: Incorrect login details.",
"worktime_review": "Note: Working time successfully checked!",
"worktime_review_unlock": "Note: Review successfully canceled for working hours!",
"worktime_easymode_start": "Note: Your shift has started successfully!",
"worktime_easymode_end": "Note: Your shift has ended successfully!",
"worktime_easymode_pause_start": "Note: Your break has started successfully!",
"worktime_easymode_pause_end": "Note: Your break has ended successfully!",
"easymode_toggled": "Note: The mode was successfully switched!",
"error": "Note: An error has occurred. Please check the log if possible.",
"statemismatch": "Error: Security error",
"ldapauth": "Error: The authentication via LDAP failed!",
"ldapcreated": "Note: Please login again. Your account has just been created. (LDAP allowed self-login)",
"notification_not_found": "Error: Notification not found."

}
"worktime_deleted": "[BLUE]Note: Work time successfully deleted![/BLUE]",
"logged_out": "[BLUE]Note: Successfully logged out![/BLUE]",
"error_sickness": "[RED]Error: Your sickness could not be saved. Please contact your administrator![/RED]",
"error_vacation": "[RED]Error: Your vacation could not be saved. Please contact your administrator![/RED]",
"vacation_added": "[GREEN]Note: Your vacation has been saved successfully![/GREEN]",
"sickness_added": "[BLUE]Note: Your sickness has been saved successfully![/BLUE]",
"notifications_entry_deleted": "Note: Notification entry deleted![/BLUE]",
"noperms": "[YELLOW]Note: Missing permissions[/YELLOW]",
"user_deleted": "[BLUE]Note: User successfully deleted![/BLUE]",
"created_user": "[GREEN]Note: User successfully created![/GREEN]",
"worktime_added": "[GREEN]Note: Work time successfully added![/GREEN]",
"password_changed": "[YELLOW]Note: Your password has been changed successfully. Please log in again.[/YELLOW]",
"password_change_failed": "[RED]Error: Your password could not be changed, please contact support.[/RED]",
"password_reset": "[YELLOW]Note: An email has been sent so you can reset your password.[/YELLOW]",
"nodata": "[RED]Error: No username or password entered.[/RED]",
"wrongdata": "[RED]Error: Incorrect login credentials.[/RED]",
"worktime_review": "[GREEN]Note: Work time successfully submitted for review![/GREEN]",
"worktime_review_unlock": "[GREEN]Note: Review successfully removed for work time![/GREEN]",
"worktime_easymode_start": "[GREEN]Note: Your shift has started successfully![/GREEN]",
"worktime_easymode_end": "[GREEN]Note: Your shift has ended successfully![/GREEN]",
"worktime_easymode_pause_start": "[GREEN]Note: Your break has started successfully![/GREEN]",
"worktime_easymode_pause_end": "[GREEN]Note: Your break has ended successfully![/GREEN]",
"easymode_toggled": "[GREEN]Note: Mode successfully toggled![GREEN]",
"error": "[RED]Note: An error has occurred. Please check the log if possible.[/RED]",
"statemismatch": "[RED]Error: Security error[/RED]",
"ldapauth": "[RED]Error: LDAP authentication failed.[/RED]",
"ldapcreated": "[YELLOW]Note: Please log in again. Your user account has now been created. (LDAP allowed self-login)[/YELLOW]",
"notification_not_found": "[RED]Error: Notification not found.[/RED]"
}
58 changes: 29 additions & 29 deletions api/v1/class/i18n/suite/status/snippets_NL.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"worktime_deleted": "Opmerking: werktijd succesvol verwijderd!",
"logged_out": "Opmerking: succesvol uitgelogd!",
"error_sickness": "Fout: uw ziekte kon niet worden opgeslagen. Neem contact op met uw beheerder!",
"error_vacation": "Fout: uw vakantie kon niet worden opgeslagen. Neem contact op met uw beheerder!",
"vacation_added": "Opmerking: uw vakantie is succesvol opgeslagen!",
"sickness_added": "Opmerking: uw ziekte is met succes opgeslagen!",
"notifications_entry_deleted": "Opmerking: agenda-item verwijderd!",
"noperms": "Opmerking: ontbrekende machtigingen",
"user_deleted": "Opmerking: gebruiker is succesvol verwijderd!",
"created_user": "Opmerking: gebruiker is succesvol aangemaakt!",
"worktime_added": "Opmerking: werktijd succesvol toegevoegd!",
"password_changed": "Opmerking: uw wachtwoord is succesvol gewijzigd. Meld u opnieuw aan.",
"password_change_failed": "Fout: uw wachtwoord kon niet worden gewijzigd. Neem contact op met de ondersteuning.",
"password_reset": "Opmerking: er is een e-mail verzonden zodat u uw wachtwoord opnieuw kunt instellen.",
"nodata": "Fout: er is geen gebruikersnaam of wachtwoord ingevoerd.",
"wrongdata": "Fout: onjuiste inloggegevens.",
"worktime_review": "Opmerking: werktijd succesvol gecontroleerd!",
"worktime_review_unlock": "Opmerking: recensie is geannuleerd vanwege werkuren!",
"worktime_easymode_start": "Opmerking: uw dienst is succesvol begonnen!",
"worktime_easymode_end": "Opmerking: uw dienst is succesvol beëindigd!",
"worktime_easymode_pause_start": "Opmerking: uw pauze is succesvol begonnen!",
"worktime_easymode_pause_end": "Opmerking: uw pauze is succesvol beëindigd!",
"easymode_toggled": "Opmerking: de modus is succesvol gewijzigd!",
"error": "Opmerking: er is een fout opgetreden. Controleer indien mogelijk het logboek.",
"statemismatch": "Fout: beveiligingsfout",
"ldapauth": "Fout: Authenticatie via LDAP mislukt.",
"ldapcreated": "Opmerking: log opnieuw in. Uw gebruikersaccount is nu aangemaakt. (LDAP staat zelfinloggen toe)",
"notification_not_found": "Fout: melding niet gevonden."
}
"worktime_deleted": "[BLUE]Opmerking: Werkuren succesvol verwijderd![/BLUE]",
"logged_out": "[BLUE]Opmerking: Succesvol uitgelogd![/BLUE]",
"error_sickness": "[RED]Fout: Je ziekte kon niet worden opgeslagen. Neem contact op met je beheerder![/RED]",
"error_vacation": "[RED]Fout: Je vakantie kon niet worden opgeslagen. Neem contact op met je beheerder![/RED]",
"vacation_added": "[GREEN]Opmerking: Je vakantie is succesvol opgeslagen![/GREEN]",
"sickness_added": "[BLUE]Opmerking: Je ziekte is succesvol opgeslagen![/BLUE]",
"notifications_entry_deleted": "Opmerking: Notificatie-item verwijderd![/BLUE]",
"noperms": "[YELLOW]Opmerking: Onvoldoende rechten[/YELLOW]",
"user_deleted": "[BLUE]Opmerking: Gebruiker succesvol verwijderd![/BLUE]",
"created_user": "[GREEN]Opmerking: Gebruiker succesvol aangemaakt![/GREEN]",
"worktime_added": "[GREEN]Opmerking: Werkuren succesvol toegevoegd![/GREEN]",
"password_changed": "[YELLOW]Opmerking: Je wachtwoord is succesvol gewijzigd. Log opnieuw in.[/YELLOW]",
"password_change_failed": "[RED]Fout: Je wachtwoord kon niet worden gewijzigd, neem contact op met support.[/RED]",
"password_reset": "[YELLOW]Opmerking: Er is een e-mail verstuurd om je wachtwoord te resetten.[/YELLOW]",
"nodata": "[RED]Fout: Geen gebruikersnaam of wachtwoord ingevoerd.[/RED]",
"wrongdata": "[RED]Fout: Onjuiste inloggegevens.[/RED]",
"worktime_review": "[GREEN]Opmerking: Werkuren succesvol ter controle ingediend![/GREEN]",
"worktime_review_unlock": "[GREEN]Opmerking: Controle succesvol opgeheven voor werkuren![/GREEN]",
"worktime_easymode_start": "[GREEN]Opmerking: Je dienst is succesvol gestart![/GREEN]",
"worktime_easymode_end": "[GREEN]Opmerking: Je dienst is succesvol beëindigd![/GREEN]",
"worktime_easymode_pause_start": "[GREEN]Opmerking: Je pauze is succesvol gestart![/GREEN]",
"worktime_easymode_pause_end": "[GREEN]Opmerking: Je pauze is succesvol beëindigd![/GREEN]",
"easymode_toggled": "[GREEN]Opmerking: Modus succesvol gewijzigd![GREEN]",
"error": "[RED]Opmerking: Er is een fout opgetreden. Controleer het logbestand indien mogelijk.[/RED]",
"statemismatch": "[RED]Fout: Beveiligingsfout[/RED]",
"ldapauth": "[RED]Fout: LDAP-authenticatie mislukt.[/RED]",
"ldapcreated": "[YELLOW]Opmerking: Log opnieuw in. Je account is nu aangemaakt. (LDAP self-login toegestaan)[/YELLOW]",
"notification_not_found": "[RED]Fout: Notificatie niet gevonden.[/RED]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Toil\EP;
use Arbeitszeit\Arbeitszeit;
use Arbeitszeit\StatusMessages;
use Arbeitszeit\Exceptions;
use Arbeitszeit\Benutzer;
use Arbeitszeit\Auth;
use NFClogin\NFClogin;
Expand Down Expand Up @@ -49,7 +50,8 @@ public function get()
}

} catch (\Exception $e) {
echo json_encode(["error" => true, "message" => $e->getMessage()]);
Exceptions::error_rep("An error occurred while processing the NFC login: " . $e->getMessage());
echo json_encode(["error" => true, "message" => "An error occured."]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use Toil\EP;
use Arbeitszeit\Arbeitszeit;
use Arbeitszeit\Exceptions;
use Arbeitszeit\Benutzer;
use NFClogin\NFClogin;

Expand Down Expand Up @@ -39,7 +40,8 @@ public function get()
}
echo json_encode($data);
} catch (\Exception $e) {
echo json_encode(["error" => true, "message" => $e->getMessage()]);
Exceptions::error_rep("An error occured while reading authentication block 4: " . $e->getMessage());
echo json_encode(["error" => true, "message" => "An error occured."]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use Toil\EP;
use Arbeitszeit\Arbeitszeit;
use Arbeitszeit\Exceptions;
use NFClogin\NFClogin;

class readNfc implements EPInterface
Expand Down Expand Up @@ -35,7 +36,8 @@ public function get()
$data = $nfc->readCard();
echo json_encode($data);
} catch (\Exception $e) {
echo json_encode(["error" => true, "message" => $e->getMessage()]);
Exceptions::error_rep("An error occurred while reading the NFC card: " . $e->getMessage());
echo json_encode(["error" => true, "message" => "An error occured."]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

use Toil\EP;
use Arbeitszeit\Arbeitszeit;
use Arbeitszeit\Exceptions;
use NFClogin\NFClogin;
use Arbeitszeit\Benutzer;

Expand Down Expand Up @@ -41,7 +42,8 @@ public function get()
$data = $nfc->assignCard((int)$user["id"]);
echo json_encode($data);
} catch (\Exception $e) {
echo json_encode(["error" => true, "message" => $e->getMessage()]);
Exceptions::error_rep("An error occurred while writing to the NFC card: " . $e->getMessage());
echo json_encode(["error" => true, "message" => "An error occured."]);
}
}

Expand Down
3 changes: 2 additions & 1 deletion api/v1/class/plugins/plugins/nfclogin/views/cards.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require_once dirname(__DIR__, 1) . "/src/Main.php";

use Arbeitszeit\Arbeitszeit;
use Arbeitszeit\Exceptions;
use NFClogin\NFClogin;

$arbeit = new Arbeitszeit;
Expand Down Expand Up @@ -45,7 +46,7 @@
echo "No card detected.";
}
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
Exceptions::error_rep("An error occured while reading the card: " . $e->getMessage());
}
?>
</p><hr width="75%">
Expand Down
7 changes: 4 additions & 3 deletions api/v1/class/plugins/plugins/pluginmanager/views/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use pluginmanager\pluginmanager;
use Arbeitszeit\Arbeitszeit;
use Arbeitszeit\Exceptions;
use Arbeitszeit\i18n;

$main = new pluginmanager();
$arbeit = new Arbeitszeit();
Expand All @@ -30,12 +31,12 @@
}
if(@isset($_GET["disabled"])){
Exceptions::error_rep("[pluginmanager] Disabling plugin: {$_GET["edit"]}...");
$main->disablePlugin($_GET["edit"]);
$main->disablePlugin($arbeit->i18n()->sanitizeOutput($_GET["edit"]));
$status = "<div class='alert alert-success' role='alert'>Plugin disabled! You may want to reload the windows for the YAML configuration to reload if it still shows 'false'.</div>";
}
if(@isset($_GET["enabled"])){
Exceptions::error_rep("[pluginmanager] Enabling plugin: {$_GET["edit"]}...");
$main->enablePlugin($_GET["edit"]);
$main->enablePlugin($arbeit->i18n()->sanitizeOutput($_GET["edit"]));
$status = "<div class='alert alert-success' role='alert'>Plugin enabled! You may want to reload the windows for the YAML configuration to reload if it still shows 'false'.</div>";
}
skip_get:
Expand Down Expand Up @@ -66,7 +67,7 @@
<form method="get">
<div id="plugins">
<p>Plugin Configuration:</p>
</div><code><pre><?php echo $yaml; ?></pre></code>
</div><code><pre><?php echo $arbeit->i18n()->sanitizeOutput($yaml); ?></pre></code>
<div id="reload">
<p><label class="form-label">Enabled?</label><input type="checkbox" name="enabled" <?php echo $isEnabled; ?>></p>
<p><label>Disable? <input type="checkbox" name="disabled" <?php echo $isDisabled; ?>></label></p>
Expand Down
4 changes: 3 additions & 1 deletion api/v1/class/plugins/plugins/userdetail/views/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
require_once $_SERVER["DOCUMENT_ROOT"] . "/api/v1/class/plugins/loader.plugins.arbeit.inc.php";
require_once dirname(__DIR__, 1) . "/src/Main.php";

use Arbeitszeit\Arbeitszeit;
use Userdetail\Userdetail;
use Arbeitszeit\Benutzer;
use Arbeitszeit\Auth;

$a = new Arbeitszeit;
$benutzer = new Benutzer;
$auth = new Auth;
$main = new Userdetail;
Expand Down Expand Up @@ -63,7 +65,7 @@
}
}

$r = $main->get_employee_data($_GET["user"]);
$r = $main->get_employee_data($a->i18n()->sanitizeOutput($_GET["user"]));
$notes = $r["notes"] ?? "";
$pos = $r["position"] ?? "";
$eid = $r["employee-id"] ?? "";
Expand Down
Loading
Loading