Exemplo n.º 1
0
 public static function registerModule()
 {
     Consumer::registerModule();
     Token::registerModule();
     Access::registerModule();
     Account::registerModule();
 }
Exemplo n.º 2
0
 public function setupDatabaseContent()
 {
     $this->createIdentification('Student', 'Schüler / Eltern');
     $this->createIdentification('Teacher', 'Lehrer');
     $this->createIdentification('Management', 'Verwaltung');
     $this->createIdentification('System', 'System');
     $tblConsumer = Consumer::useService()->getConsumerById(1);
     $tblIdentification = $this->getIdentificationByName('System');
     $tblRole = Access::useService()->getRoleByName('Administrator');
     // System (Gerd)
     $tblToken = Token::useService()->getTokenByIdentifier('ccccccdilkui');
     $tblAccount = $this->createAccount('System', 'System', $tblToken, $tblConsumer);
     $this->addAccountAuthentication($tblAccount, $tblIdentification);
     $this->addAccountAuthorization($tblAccount, $tblRole);
     // System (Jens)
     $tblToken = Token::useService()->getTokenByIdentifier('ccccccectjge');
     $tblAccount = $this->createAccount('Kmiezik', 'System', $tblToken, $tblConsumer);
     $this->addAccountAuthentication($tblAccount, $tblIdentification);
     $this->addAccountAuthorization($tblAccount, $tblRole);
     // System (Sidney)
     $tblToken = Token::useService()->getTokenByIdentifier('ccccccectjgt');
     $tblAccount = $this->createAccount('Rackel', 'System', $tblToken, $tblConsumer);
     $this->addAccountAuthentication($tblAccount, $tblIdentification);
     $this->addAccountAuthorization($tblAccount, $tblRole);
     // System (Johannes)
     $tblToken = Token::useService()->getTokenByIdentifier('ccccccectjgr');
     $tblAccount = $this->createAccount('Kauschke', 'System', $tblToken, $tblConsumer);
     $this->addAccountAuthentication($tblAccount, $tblIdentification);
     $this->addAccountAuthorization($tblAccount, $tblRole);
 }
Exemplo n.º 3
0
 /**
  * @param string $ConsumerAcronym
  * @param string $ConsumerName
  *
  * @return Stage
  */
 public static function frontendConsumer($ConsumerAcronym, $ConsumerName)
 {
     $Stage = new Stage('Mandanten');
     $tblConsumerAll = Consumer::useService()->getConsumerAll();
     $Stage->setContent(new TableData($tblConsumerAll, new Title('Bestehende Mandanten'), array('Acronym' => 'Mandanten-Kürzel', 'Name' => 'Mandanten-Name')) . Consumer::useService()->createConsumer(new Form(new FormGroup(new FormRow(array(new FormColumn(new TextField('ConsumerAcronym', 'Kürzel des Mandanten', 'Kürzel des Mandanten'), 4), new FormColumn(new TextField('ConsumerName', 'Name des Mandanten', 'Name des Mandanten'), 8))), new \SPHERE\Common\Frontend\Form\Repository\Title('Mandant anlegen')), new Primary('Hinzufügen')), $ConsumerAcronym, $ConsumerName));
     return $Stage;
 }
Exemplo n.º 4
0
 public function setupDatabaseContent()
 {
     $this->createToken('ccccccdilkui', Consumer::useService()->getConsumerByAcronym('DEMO'));
     $this->createToken('ccccccectjge', Consumer::useService()->getConsumerByAcronym('DEMO'));
     $this->createToken('ccccccectjgt', Consumer::useService()->getConsumerByAcronym('DEMO'));
     $this->createToken('ccccccectjgr', Consumer::useService()->getConsumerByAcronym('DEMO'));
 }
Exemplo n.º 5
0
 public function setupDatabaseContent()
 {
     $this->createToken('ccccccdilkui');
     $this->createToken('ccccccectjge');
     // Remove
     //        $this->createToken('ccccccectjkd');
     $this->createToken('ccccccectjiu', Consumer::useService()->getConsumerById(1));
     $this->createToken('ccccccectjiv', Consumer::useService()->getConsumerById(1));
     $this->createToken('ccccccectjjc', Consumer::useService()->getConsumerById(4));
     $this->createToken('ccccccectjjb', Consumer::useService()->getConsumerById(5));
     $this->createToken('ccccccectjjd', Consumer::useService()->getConsumerById(6));
     $this->createToken('ccccccectjje', Consumer::useService()->getConsumerById(2));
     $this->createToken('ccccccectjjf', Consumer::useService()->getConsumerById(7));
     $this->createToken('ccccccectjjg', Consumer::useService()->getConsumerById(7));
     $this->createToken('ccccccectjjh', Consumer::useService()->getConsumerById(8));
     $this->createToken('ccccccdtrire', Consumer::useService()->getConsumerById(3));
     $this->createToken('ccccccdjclnc', Consumer::useService()->getConsumerById(3));
     $this->createToken('ccccccectjji', Consumer::useService()->getConsumerById(9));
     $this->createToken('ccccccectjjj', Consumer::useService()->getConsumerById(1));
     $this->createToken('ccccccectjjk', Consumer::useService()->getConsumerById(1));
     $this->createToken('ccccccectjjl', Consumer::useService()->getConsumerById(1));
     $this->createToken('ccccccectjgt');
     $this->createToken('ccccccectjgr');
     $this->createToken('ccccccectjjn', Consumer::useService()->getConsumerById(10));
     // Remove
     //        $this->createToken('ccccccectjke');
     $this->createToken('ccccccectjgl', Consumer::useService()->getConsumerById(6));
     $this->createToken('ccccccectjjr', Consumer::useService()->getConsumerById(1));
     $this->createToken('ccccccectjkg', Consumer::useService()->getConsumerById(1));
     $this->createToken('ccccccectjkf', Consumer::useService()->getConsumerById(1));
     $this->createToken('ccccccectjgn', Consumer::useService()->getConsumerById(9));
 }
Exemplo n.º 6
0
 /**
  * @param int $Consumer
  *
  * @return Stage
  */
 public static function frontendChangeConsumer($Consumer = null)
 {
     $tblAccount = Account::useService()->getAccountBySession();
     $Stage = new Stage('Mein Benutzerkonto', 'Mandant ändern');
     $Stage->setContent(new Layout(new LayoutGroup(new LayoutRow(new LayoutColumn(MyAccount::useService()->updateConsumer(new Form(new FormGroup(new FormRow(array(new FormColumn(new Panel('Mandant', array(new SelectBox('Consumer', 'Neuer Mandant', array('{{ Acronym }} {{ Name }}' => Consumer::useService()->getConsumerAll()), new Building())), Panel::PANEL_TYPE_INFO))))), new Primary('Neuen Mandant speichern')), $tblAccount, $Consumer))), new Title('Mandant ändern'))));
     return $Stage;
 }
Exemplo n.º 7
0
 /**
  * @return bool|TblConsumer
  */
 public function getServiceTblConsumer()
 {
     if (null === $this->serviceTblConsumer) {
         return false;
     } else {
         return Consumer::useService()->getConsumerById($this->serviceTblConsumer);
     }
 }
Exemplo n.º 8
0
 /**
  * @return Stage
  */
 public static function frontendAccount()
 {
     $Stage = new Stage('Benutzerkonnten');
     $tblAccount = Account::useService()->getAccountBySession();
     if ($tblAccount) {
         $isSystem = Account::useService()->hasAuthorization($tblAccount, Access::useService()->getRoleByName('Administrator'));
     } else {
         $isSystem = false;
     }
     $tblConsumer = Consumer::useService()->getConsumerBySession();
     // Token
     $tblTokenAll = Token::useService()->getTokenAll();
     array_walk($tblTokenAll, function (TblToken &$tblToken) {
         if (Account::useService()->getAccountAllByToken($tblToken)) {
             $tblToken = false;
         } else {
             $tblToken = new RadioBox('Account[Token]', implode(' ', str_split($tblToken->getSerial(), 4)), $tblToken->getId());
         }
     });
     $tblTokenAll = array_filter($tblTokenAll);
     array_unshift($tblTokenAll, new RadioBox('Account[Token]', new \SPHERE\Common\Frontend\Text\Repository\Danger('KEIN Hardware-Token'), null));
     // Identification
     $tblIdentificationAll = Account::useService()->getIdentificationAll();
     /** @noinspection PhpUnusedParameterInspection */
     array_walk($tblIdentificationAll, function (TblIdentification &$tblIdentification, $Index, $isSystem) {
         if ($tblIdentification->getName() == 'System' && !$isSystem) {
             $tblIdentification = false;
         } else {
             $tblIdentification = new RadioBox('Account[Identification]', $tblIdentification->getDescription(), $tblIdentification->getId());
         }
     }, $isSystem);
     $tblIdentificationAll = array_filter($tblIdentificationAll);
     // Role
     $tblRoleAll = Access::useService()->getRoleAll();
     /** @noinspection PhpUnusedParameterInspection */
     array_walk($tblRoleAll, function (TblRole &$tblRole, $Index, $isSystem) {
         if ($tblRole->getName() == 'Administrator' && !$isSystem) {
             $tblRole = false;
         } else {
             $tblRole = new CheckBox('Account[Role][' . $tblRole->getId() . ']', $tblRole->getName(), $tblRole->getId());
         }
     }, $isSystem);
     $tblRoleAll = array_filter($tblRoleAll);
     // Account
     $tblAccountAll = Account::useService()->getAccountAll();
     array_walk($tblAccountAll, function (TblAccount &$tblAccount) {
         /** @noinspection PhpUndefinedFieldInspection */
         $tblAccount->Option = new Danger('Löschen', '/Platform/Gatekeeper/Authorization/Account/Destroy', new Remove(), array('Id' => $tblAccount->getId()), 'Löschen');
     });
     $Stage->setContent(($tblAccountAll ? new TableData($tblAccountAll, new Title('Bestehende Benutzerkonnten'), array('Username' => 'Benutzername')) : new Warning('Keine Benutzerkonnten vorhanden')) . new Form(array(new FormGroup(array(new FormRow(array(new FormColumn((new TextField('Account[Name]', 'Benutzername', 'Benutzername', new Person()))->setPrefixValue($tblConsumer->getAcronym()), 4), new FormColumn(new PasswordField('Account[Password]', 'Passwort', 'Passwort', new Lock()), 4), new FormColumn(new PasswordField('Account[PasswordSafety]', 'Passwort wiederholen', 'Passwort wiederholen', new Repeat()), 4)))), new \SPHERE\Common\Frontend\Form\Repository\Title('Benutzerkonnto anlegen')), new FormGroup(array(new FormRow(array(new FormColumn(array(new Panel('Authentifizierungstyp', $tblIdentificationAll)), 4), new FormColumn(array(new Panel('Berechtigungsstufe', $tblRoleAll)), 4), new FormColumn(array(new Panel('Hardware-Token', $tblTokenAll)), 4)))), new \SPHERE\Common\Frontend\Form\Repository\Title('Berechtigungen zuweisen'))), new Primary('Hinzufügen')));
     return $Stage;
 }
Exemplo n.º 9
0
 /**
  * @return Layout
  */
 public function frontendLayoutToken()
 {
     $tblTokenAll = Token::useService()->getTokenAllByConsumer(Consumer::useService()->getConsumerBySession());
     if ($tblTokenAll !== false) {
         array_walk($tblTokenAll, function (TblToken &$tblToken) {
             $Serial = $tblToken->getSerial();
             $Serial = substr($Serial, 0, 4) . ' ' . substr($Serial, 4, 4);
             $Content = array();
             $tblAccountAll = $tblToken->getAccountAllByToken();
             if (!empty($tblAccountAll)) {
                 array_walk($tblAccountAll, function (TblAccount &$tblAccount) {
                     $tblAccount = new PullClear(new PullLeft(new PersonKey() . ' ' . $tblAccount->getUsername()) . new PullRight(new Standard('', '/Setting/Authorization/Account', new PersonKey(), array('Id' => $tblAccount->getId()), 'zu ' . $tblAccount->getUsername() . ' wechseln')));
                 });
                 $Content = array_merge($Content, $tblAccountAll);
                 $Content = array_filter($Content);
                 array_unshift($Content, new Info(new Exclamation() . ' ' . new Small('Benutzerkonten verknüpft')));
             } else {
                 $Content = array(new Muted(new Small('Keine Benutzerkonten verknüpft')), new Muted(new Small('Der Schlüssel kann gefahrlos entfernt werden')));
             }
             $tblToken = new LayoutColumn(new Panel(new YubiKey() . ' ' . $Serial, $Content, Panel::PANEL_TYPE_INFO, empty($tblAccountAll) ? new Standard('', '/Setting/Authorization/Token/Destroy', new Remove(), array('Id' => $tblToken->getId()), 'Schlüssel ' . $Serial . ' löschen') : new Muted(new Small('Der Schlüssel kann nicht entfernt werden'))), 3);
         });
     } else {
         $tblTokenAll = array(new LayoutColumn(new Warning('Keine Hardware-Schlüssel hinterlegt')));
     }
     $LayoutRowList = array();
     $LayoutRowCount = 0;
     $LayoutRow = null;
     /**
      * @var LayoutColumn $tblToken
      */
     foreach ($tblTokenAll as $tblToken) {
         if ($LayoutRowCount % 4 == 0) {
             $LayoutRow = new LayoutRow(array());
             $LayoutRowList[] = $LayoutRow;
         }
         $LayoutRow->addColumn($tblToken);
         $LayoutRowCount++;
     }
     return new Layout(new LayoutGroup($LayoutRowList));
 }
Exemplo n.º 10
0
 /**
  * @return Stage
  */
 public function frontendStatus()
 {
     $Stage = new Stage('Database', 'Status');
     $this->menuButton($Stage);
     $Configuration = parse_ini_file(__DIR__ . '/../../../../System/Database/Configuration.ini', true);
     $Result = array();
     foreach ((array) $Configuration as $Service => $Parameter) {
         $Service = explode(':', $Service);
         // Force Consumer ?
         if (!isset($Service[4]) && (!isset($Parameter['Consumer']) || $Parameter['Consumer'])) {
             $tblConsumerAll = Consumer::useService()->getConsumerAll();
             /** @var TblConsumer $tblConsumer */
             foreach ((array) $tblConsumerAll as $tblConsumer) {
                 $Connection = null;
                 $Service[4] = $tblConsumer->getAcronym();
                 try {
                     $Connection = new \SPHERE\System\Database\Database(new Identifier($Service[0], $Service[1], isset($Service[2]) ? $Service[2] : null, isset($Service[3]) ? $Service[3] : null, isset($Service[4]) ? $Service[4] : null));
                     $Status = new Success('Verbunden', new Ok());
                 } catch (\Exception $E) {
                     $Status = new Danger('Fehler', new Warning());
                 }
                 $Result[] = $this->statusRow($Status, $Service, $Parameter, $Connection);
             }
         } else {
             $Connection = null;
             try {
                 $Connection = new \SPHERE\System\Database\Database(new Identifier($Service[0], $Service[1], isset($Service[2]) ? $Service[2] : null, isset($Service[3]) ? $Service[3] : null, isset($Service[4]) ? $Service[4] : null));
                 $Status = new Success('Verbunden', new Ok());
             } catch (\Exception $E) {
                 $Status = new Danger('Fehler', new Warning());
             }
             $Result[] = $this->statusRow($Status, $Service, $Parameter, $Connection);
         }
     }
     $Stage->setContent(new Table(new TableHead(new TableRow(array(new TableColumn('Status'), new TableColumn('Cluster'), new TableColumn('Application'), new TableColumn('Module'), new TableColumn('Service'), new TableColumn('Consumer'), new TableColumn('Driver'), new TableColumn('Server'), new TableColumn('Port'), new TableColumn('Database')))), new TableBody($Result), null, true));
     return $Stage;
 }
 /**
  * @return Service
  */
 public static function useService()
 {
     return new Service(new Identifier('Setting', 'Consumer', 'SponsorAssociation', null, Consumer::useService()->getConsumerBySession()), __DIR__ . '/Service/Entity', __NAMESPACE__ . '\\Service\\Entity');
 }
Exemplo n.º 12
0
 /**
  * @param IFormInterface $Form
  * @param TblAccount     $tblAccount
  * @param int            $Consumer
  *
  * @return IFormInterface|Redirect
  */
 public function updateConsumer(IFormInterface &$Form, TblAccount $tblAccount, $Consumer)
 {
     if (null === $Consumer) {
         return $Form;
     }
     $Error = false;
     if (empty($Consumer)) {
         $Form->setError('Consumer', 'Bitte wählen Sie einen Mandanten aus');
         $Error = true;
     }
     if ($Error) {
         return $Form;
     } else {
         $tblConsumer = Consumer::useService()->getConsumerById($Consumer);
         if (Account::useService()->changeConsumer($tblConsumer, $tblAccount)) {
             return new Success('Der Mandant wurde erfolgreich geändert') . new Redirect('/Setting/MyAccount', 1);
         } else {
             return new Danger('Der Mandant konnte nicht geändert werden') . new Redirect('/Setting/MyAccount', 10);
         }
     }
 }
Exemplo n.º 13
0
 /**
  * @param IFormInterface $Form
  * @param array          $Account
  *
  * @return IFormInterface
  */
 public function createAccount(IFormInterface $Form, $Account)
 {
     if (null === $Account) {
         return $Form;
     }
     $Error = false;
     $Username = trim($Account['Name']);
     $Password = trim($Account['Password']);
     $PasswordSafety = trim($Account['PasswordSafety']);
     $tblConsumer = GatekeeperConsumer::useService()->getConsumerBySession();
     if (!($tblToken = GatekeeperToken::useService()->getTokenById((int) $Account['Token']))) {
         $tblToken = null;
     }
     if (empty($Username)) {
         $Form->setError('Account[Name]', 'Bitte geben Sie einen Benutzernamen an');
         $Error = true;
     } else {
         if (preg_match('!^[a-z0-9]{5,}$!is', $Username)) {
             $Username = $tblConsumer->getAcronym() . '-' . $Username;
             if (!GatekeeperAccount::useService()->getAccountByUsername($Username)) {
                 $Form->setSuccess('Account[Name]', '');
             } else {
                 $Form->setError('Account[Name]', 'Der angegebene Benutzername ist bereits vergeben');
                 $Error = true;
             }
         } else {
             $Form->setError('Account[Name]', 'Der Benutzername darf nur Buchstaben und Zahlen enthalten und muss mindestens 5 Zeichen lang sein');
             $Error = true;
         }
     }
     if (empty($Password)) {
         $Form->setError('Account[Password]', 'Bitte geben Sie ein Passwort an');
         $Error = true;
     } else {
         if (strlen($Password) >= 8) {
             $Form->setSuccess('Account[Password]', '');
         } else {
             $Form->setError('Account[Password]', 'Das Passwort muss mindestens 8 Zeichen lang sein');
             $Error = true;
         }
     }
     if (empty($PasswordSafety)) {
         $Form->setError('Account[PasswordSafety]', 'Bitte geben Sie das Passwort erneut an');
         $Error = true;
     }
     if ($Password != $PasswordSafety) {
         $Form->setError('Account[Password]', '');
         $Form->setError('Account[PasswordSafety]', 'Die beiden Passworte stimmen nicht überein');
         $Error = true;
     } else {
         if (!empty($Password) && !empty($PasswordSafety)) {
             $Form->setSuccess('Account[PasswordSafety]', '');
         } else {
             $Form->setError('Account[PasswordSafety]', '');
         }
     }
     if (!$Error) {
         $tblAccount = GatekeeperAccount::useService()->insertAccount($Username, $Password, $tblToken, $tblConsumer);
         if ($tblAccount) {
             $tblIdentification = GatekeeperAccount::useService()->getIdentificationById($Account['Identification']);
             GatekeeperAccount::useService()->addAccountAuthentication($tblAccount, $tblIdentification);
             if (isset($Account['Role'])) {
                 foreach ((array) $Account['Role'] as $Role) {
                     $tblRole = GatekeeperAccess::useService()->getRoleById($Role);
                     GatekeeperAccount::useService()->addAccountAuthorization($tblAccount, $tblRole);
                 }
             }
             if (isset($Account['User'])) {
                 $tblPerson = Person::useService()->getPersonById($Account['User']);
                 GatekeeperAccount::useService()->addAccountPerson($tblAccount, $tblPerson);
             }
             return new Success('Das Benutzerkonnto wurde erstellt') . new Redirect('/Setting/Authorization/Account', 3);
         } else {
             return new Danger('Das Benutzerkonnto konnte nicht erstellt werden') . new Redirect('/Setting/Authorization/Account', 3);
         }
     }
     return $Form;
 }
Exemplo n.º 14
0
 /**
  * @return Service
  */
 public static function useService()
 {
     return new Service(new Identifier('Contact', 'Address', null, null, Consumer::useService()->getConsumerBySession()), __DIR__ . '/Service/Entity', __NAMESPACE__ . '\\Service\\Entity');
 }
Exemplo n.º 15
0
 /**
  * @param bool $NoConnection
  *
  * @return string
  */
 public function getContent($NoConnection = false)
 {
     $this->Template->setVariable('ManagerStyle', Style::getManager());
     $this->Template->setVariable('ManagerScript', Script::getManager());
     $this->Template->setVariable('NavigationCluster', implode('', $this->ClusterNavigation));
     $this->Template->setVariable('BreadcrumbCluster', $this->ClusterBreadcrumb);
     $this->Template->setVariable('NavigationApplication', implode('', $this->ApplicationNavigation));
     $this->Template->setVariable('BreadcrumbApplication', $this->ApplicationBreadcrumb);
     $this->Template->setVariable('NavigationModule', implode('', $this->ModuleNavigation));
     $this->Template->setVariable('BreadcrumbModule', $this->ModuleBreadcrumb);
     $this->Template->setVariable('NavigationService', implode('', $this->ServiceNavigation));
     $Debug = $this->getDebugger();
     $this->Template->setVariable('DebuggerProtocol', $Debug->getProtocol());
     $this->Template->setVariable('DebuggerHost', gethostname());
     $this->Template->setVariable('DebuggerRuntime', $Debug->getRuntime());
     $this->Template->setVariable('Content', implode('', $this->Content));
     $this->Template->setVariable('PathBase', $this->getRequest()->getPathBase());
     if (!$NoConnection) {
         $this->Template->setVariable('Consumer', '[' . Consumer::useService()->getConsumerBySession()->getAcronym() . '] ' . Consumer::useService()->getConsumerBySession()->getName());
     }
     return $this->Template->getContent();
 }
Exemplo n.º 16
0
 /**
  * @return Form
  */
 private function formAccount()
 {
     $tblConsumer = Consumer::useService()->getConsumerBySession();
     // Identification
     $tblIdentificationAll = Account::useService()->getIdentificationAll();
     array_walk($tblIdentificationAll, function (TblIdentification &$tblIdentification) {
         if ($tblIdentification->getName() == 'System') {
             $tblIdentification = false;
         } else {
             switch (strtoupper($tblIdentification->getName())) {
                 case 'STUDENT':
                     $Global = $this->getGlobal();
                     if (!isset($Global->POST['Account']['Identification'])) {
                         $Global->POST['Account']['Identification'] = $tblIdentification->getId();
                         $Global->savePost();
                     }
                     $Label = $tblIdentification->getDescription();
                     break;
                 default:
                     $Label = $tblIdentification->getDescription() . ' (' . new Key() . ')';
             }
             $tblIdentification = new RadioBox('Account[Identification]', $Label, $tblIdentification->getId());
         }
     });
     $tblIdentificationAll = array_filter($tblIdentificationAll);
     // Role
     $tblRoleAll = Access::useService()->getRoleAll();
     array_walk($tblRoleAll, function (TblRole &$tblRole) {
         if ($tblRole->getName() == 'Administrator') {
             $tblRole = false;
         } else {
             $tblRole = new CheckBox('Account[Role][' . $tblRole->getId() . ']', $tblRole->getName(), $tblRole->getId());
         }
     });
     $tblRoleAll = array_filter($tblRoleAll);
     // Token
     $Global = $this->getGlobal();
     if (!isset($Global->POST['Account']['Token'])) {
         $Global->POST['Account']['Token'] = 0;
         $Global->savePost();
     }
     $tblTokenAll = Token::useService()->getTokenAllByConsumer(Consumer::useService()->getConsumerBySession());
     array_walk($tblTokenAll, function (TblToken &$tblToken) {
         if (Account::useService()->getAccountAllByToken($tblToken)) {
             $tblToken = false;
         } else {
             $tblToken = new RadioBox('Account[Token]', implode(' ', str_split($tblToken->getSerial(), 4)), $tblToken->getId());
         }
     });
     $tblTokenAll = array_filter($tblTokenAll);
     array_unshift($tblTokenAll, new RadioBox('Account[Token]', new Danger('KEIN Hardware-Schlüssel'), 0));
     // Person
     $tblPersonAll = Account::useService()->getPersonAllHavingNoAccount();
     if ($tblPersonAll) {
         array_walk($tblPersonAll, function (TblPerson &$tblPerson) {
             $tblPerson = new RadioBox('Account[User]', $tblPerson->getFullName(), $tblPerson->getId());
         });
         $tblPersonAll = array_filter($tblPersonAll);
     }
     return new Form(array(new FormGroup(array(new FormRow(array(new FormColumn(new Panel(new PersonKey() . ' Benutzerkonto hinzufügen', array((new TextField('Account[Name]', 'Benutzername (min. 5 Zeichen)', 'Benutzername', new Person()))->setPrefixValue($tblConsumer->getAcronym()), new PasswordField('Account[Password]', 'Passwort (min. 8 Zeichen)', 'Passwort', new Lock()), new PasswordField('Account[PasswordSafety]', 'Passwort wiederholen', 'Passwort wiederholen', new Repeat())), Panel::PANEL_TYPE_INFO), 4), new FormColumn(array(new Panel(new Nameplate() . ' Berechtigungsstufe zuweisen', $tblRoleAll, Panel::PANEL_TYPE_INFO), new Panel(new Person() . ' Person zuweisen', $tblPersonAll, Panel::PANEL_TYPE_INFO, null, true)), 4), new FormColumn(array(new Panel(new Lock() . ' Authentifizierungstyp wählen', $tblIdentificationAll, Panel::PANEL_TYPE_INFO), new Panel(new Key() . ' Hardware-Schlüssel zuweisen', $tblTokenAll, Panel::PANEL_TYPE_INFO)), 4)))))));
 }
Exemplo n.º 17
0
 /**
  * @return Form
  */
 public function formArchive()
 {
     $tblConsumerAll = Consumer::useService()->getConsumerAll();
     array_push($tblConsumerAll, new TblConsumer(''));
     return new Form(new FormGroup(array(new FormRow(array(new FormColumn(new Panel('Umgebung', array(new SelectBox('Environment[Consumer]', 'Mandant', array('{{ Acronym }}: {{ Name }}' => $tblConsumerAll), new Building())))))))));
 }
Exemplo n.º 18
0
 /**
  * @return Service
  */
 public static function useService()
 {
     return new Service(new Identifier('Billing', 'Inventory', 'Item', null, Consumer::useService()->getConsumerBySession()), __DIR__ . '/Service/Entity', __NAMESPACE__ . '\\Service\\Entity');
 }
Exemplo n.º 19
0
 /**
  * @return Service
  */
 public static function useService()
 {
     return new Service(new Identifier('Education', 'Graduation', 'ScoreType', null, Consumer::useService()->getConsumerBySession()), __DIR__ . '/Service/Entity', __NAMESPACE__ . '\\Service\\Entity');
 }