{parts/gtag_head.html} {parts/gtag_body.html}
Conheça  A Ferramenta LowCode mais moderna e veloz para desenvolvimento PHP: Adianti Creator
Alteração da Div. de Log In do Theme 3 Boa tarde, gostaria de modificar o theme 3, colocando mais 01 botão e algum label na Div de log in. Como faço? Tenho que referenciar estes itens em mais quais arquivos?...
NJ
Alteração da Div. de Log In do Theme 3  
Boa tarde, gostaria de modificar o theme 3, colocando mais 01 botão e algum label na Div de log in. Como faço?
Tenho que referenciar estes itens em mais quais arquivos?

Curso Dominando o Adianti Framework

O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado!


Dominando o Adianti Framework Quero me inscrever agora!

Comentários (4)


AM

Boa noite,
para você modificar o login, precisa acessar a pasta :
app admin LoginForm.class.php e ali você pode modificar de acordo com sua necessidade.
LJ

fiz algo parecido para logar no AD, e gostaria de saber como logar em outros lugares tipo facebook ???
 
  1. <?php
  2. /**
  3. * LoginForm Registration
  4. * @author <your name here>
  5. */
  6. class LoginForm extends TPage
  7. {
  8. protected $form; // form
  9. /**
  10. * Class constructor
  11. * Creates the page and the registration form
  12. */
  13. function __construct($param)
  14. {
  15. parent::__construct();
  16. $table = new TTable;
  17. $table->width = '100%';
  18. // creates the form
  19. $this->form = new TForm('form_login');
  20. $this->form->class = 'tform';
  21. $this->form->style = 'max-width: 450px; margin:auto; margin-top:120px;';
  22. // add the notebook inside the form
  23. $this->form->add($table);
  24. // create the form fields
  25. $login = new TEntry('login');
  26. $password = new TPassword('password');
  27. // define the sizes
  28. $login->setSize('70%', 40);
  29. $password->setSize('70%', 40);
  30. $login->style = 'height:35px; font-size:14px;float:left;border-bottom-left-radius: 0;border-top-left-radius: 0;';
  31. $password->style = 'height:35px;margin-bottom: 15px;font-size:14px;float:left;border-bottom-left-radius: 0;border-top-left-radius: 0;';
  32. $row=$table->addRow();
  33. $row->addCell( new TLabel('Log in') )->colspan = 2;
  34. $row->class='tformtitle';
  35. $login->placeholder = _t('User');
  36. $password->placeholder = _t('Password');
  37. $user = '<span style="float:left;width:35px;margin-left:45px;height:35px;" class="input-group-addon"><span class="glyphicon glyphicon-user"></span></span>';
  38. $locker = '<span style="float:left;width:35px;margin-left:45px;height:35px;" class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>';
  39. $container1 = new TElement('div');
  40. $container1->add($user);
  41. $container1->add($login);
  42. $container2 = new TElement('div');
  43. $container2->add($locker);
  44. $container2->add($password);
  45. $row=$table->addRow();
  46. $row->addCell($container1)->colspan = 2;
  47. // add a row for the field password
  48. $row=$table->addRow();
  49. $row->addCell($container2)->colspan = 2;
  50. // create an action button (save)
  51. $save_button=new TButton('save');
  52. // define the button action
  53. $save_button->setAction(new TAction(array($this, 'onLogin')), 'login Interno');
  54. $save_button->class = 'btn btn-success';
  55. $save_button->style = 'font-size:18px;width:90%;padding:10px';
  56. // create an action button (save)
  57. $save_button1=new TButton('save1');
  58. // define the button action
  59. $save_button1->setAction(new TAction(array($this, 'onLoginLdap')), 'login LDAP');
  60. $save_button1->class = 'btn btn-success';
  61. $save_button1->style = 'font-size:18px;width:90%;padding:10px';
  62. $row=$table->addRow();
  63. $row->class = 'tformaction';
  64. $cell = $row->addCell( $save_button );
  65. $cell = $row->addCell( $save_button1 );
  66. $cell->colspan = 2;
  67. $cell->style = 'text-align:center';
  68. $this->form->setFields(array($login, $password, $save_button, $save_button1));
  69. // add the form to the page
  70. parent::add($this->form);
  71. }
  72. /**
  73. * Autenticates the User
  74. */
  75. function onLoginLdap()
  76. {
  77. try
  78. {
  79. TTransaction::open('permission');
  80. $activeDirectory = new ActiveDirectory();
  81. $data = $this->form->getData('StdClass');
  82. $this->form->validate();
  83. if($activeDirectory->authUser('tcesp\\'.$data->login , $data->password))
  84. {
  85. // new TMessage('info','Usuário autenticado');
  86. // verifica se exite usuario
  87. $user = SystemUser::newFromLogin($data->login);
  88. if ($user instanceof SystemUser)
  89. {
  90. //ok usuario ja esta criado e autenticado
  91. }else
  92. {
  93. $user_ad = $activeDirectory->getUser($data->login);
  94. // foi autenticado - criar usuario
  95. $novousuario = new SystemUser();
  96. $novousuario->login = $data->login;
  97. $novousuario->name = $user_ad["name"][0];
  98. $novousuario->email = $user_ad["mail"][0];
  99. $novousuario->frontpage_id = '10';
  100. $novousuario->store();
  101. $novousuario->addSystemUserGroup(new SystemGroup(2));
  102. $user = $novousuario;
  103. }
  104. TSession::regenerate();
  105. $programs = $user->getPrograms();
  106. $programs['LoginForm'] = TRUE;
  107. TSession::setValue('logged', TRUE);
  108. TSession::setValue('login', $data->login);
  109. TSession::setValue('username', $user->name);
  110. TSession::setValue('frontpage', '');
  111. TSession::setValue('programs',$programs);
  112. $frontpage = $user->frontpage;
  113. SystemAccessLog::registerLogin();
  114. if ($frontpage instanceof SystemProgram AND $frontpage->controller)
  115. {
  116. TApplication::gotoPage($frontpage->controller); // reload
  117. TSession::setValue('frontpage', $frontpage->controller);
  118. }
  119. else
  120. {
  121. TApplication::gotoPage('EmptyPage'); // reload
  122. TSession::setValue('frontpage', 'EmptyPage');
  123. }
  124. } else {
  125. new TMessage('info','Usuário ou senha incorreta');
  126. }
  127. TTransaction::close();
  128. }
  129. catch (Exception $e)
  130. {
  131. new TMessage('error',$e->getMessage());
  132. TSession::setValue('logged', FALSE);
  133. TTransaction::rollback();
  134. }
  135. }
  136. /**
  137. * Autenticates the User
  138. */
  139. function onLogin()
  140. {
  141. try
  142. {
  143. TTransaction::open('permission');
  144. $data = $this->form->getData('StdClass');
  145. $this->form->validate();
  146. $user = SystemUser::autenticate( $data->login, $data->password );
  147. if ($user)
  148. {
  149. TSession::regenerate();
  150. $programs = $user->getPrograms();
  151. $programs['LoginForm'] = TRUE;
  152. TSession::setValue('logged', TRUE);
  153. TSession::setValue('login', $data->login);
  154. TSession::setValue('username', $user->name);
  155. TSession::setValue('frontpage', '');
  156. TSession::setValue('programs',$programs);
  157. $frontpage = $user->frontpage;
  158. SystemAccessLog::registerLogin();
  159. if ($frontpage instanceof SystemProgram AND $frontpage->controller)
  160. {
  161. TApplication::gotoPage($frontpage->controller); // reload
  162. TSession::setValue('frontpage', $frontpage->controller);
  163. }
  164. else
  165. {
  166. TApplication::gotoPage('EmptyPage'); // reload
  167. TSession::setValue('frontpage', 'EmptyPage');
  168. }
  169. }
  170. TTransaction::close();
  171. }
  172. catch (Exception $e)
  173. {
  174. new TMessage('error',$e->getMessage());
  175. TSession::setValue('logged', FALSE);
  176. TTransaction::rollback();
  177. }
  178. }
  179. /**
  180. * Logout
  181. */
  182. public static function onLogout()
  183. {
  184. SystemAccessLog::registerLogout();
  185. TSession::freeSession();
  186. TApplication::gotoPage('LoginForm', '');
  187. }
  188. }
  189. </code>
</your>
C

Boa noite sei que Post é antigo mas busco solução para logar. no AD se alguém puder ajudar
GM

@chberta, conseguiu? se sim, pv....