We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Intranet help

Hello.

In my job, we developed 7 years ago an Intranet without a PHP framework. The project has grown and we have decided to seek a framework that is best fitting to our needs. I have read a lot about PHP frameworks and after reading this publication (“Best PHP Frameworks for 2014” https://www.sitepoint.com/best-php-frameworks-2014/ by Bruno Skvorc), I decided to write in forums Laravel, Phalcon and Symfony. Below I briefly describe the process:

  1. The user enters their user name and network password and validated in an Active Directory. Should be right credentials, this in turn returns the identification of the person.
  2. With this identification leads to two databases, external applications developed by third parties, where other data are obtained and the type of user that is (Type A, B or C) is identified
  3. Like any Intranet, presents only what the user or type of user is allowed to view and access.
  4. The user has access to certain applications that interact with other databases and applications, developed in-house and other third parties. The new Intranet applications will be developed with ExtJs and jQuery. The doubts I have are:
  5. The access to Active Directory and access to data it returns.
  6. Interaction with different databases at once (Oracle, MySql, MSSQL Server). Given that the data will be extracted from databases which differ from standard require some frameworks, such as primary key with the name ID.
  7. We do not have and do not have the opportunity to have a server component, everything should work with sentences databases.
  8. Most accesses databases are selects, but Oracle has also insert and update I hope that somehow, in this forum, you can help me clear my doubts. Thanks in advance for your answers I apologize for my English. It is not my native language. SAAG


98.9k

Some answers:

  1. You can use this library to authenticate against ActiveDirectory: https://adldap.sourceforge.net/
  2. Check the ACL component to implement a control access list, this will control which actions can be performed for specific users: https://docs.phalcon.io/en/latest/reference/acl.html
  3. Phalcon is able to connect to several databases https://docs.phalcon.io/en/latest/reference/db.html

Thank you Phalcon for the answer. I have read the information and I'll try it. I have just two doubts.

  1. I can not find an adapter MSSql Server, but I have read this https://forum.phalcon.io/discussion/1004/sql-server-adapter. In my case it is necessary to have this adapter.

  2. I need to bring information simultaneously in two different databases. Is this code correct?

Connection file

<?php

$configMy = array( "host" => "127.0.0.1", "username" => "user", "password" => "password", "dbname" => "test" ); $connMySql = new \Phalcon\Db\Adapter\Pdo\Mysql($configMy);

$configO = array( 'dbname' => '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=xe)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=20)(DELAY=5))))', 'username' => 'scott', 'password' => 'tiger', 'charset' => 'AL32UTF8', ); $connOracle = new \Phalcon\Db\Adapter\Pdo\Oracle($configO);

Finding rows file

$sql = "SELECT* FROM table_my"; $resultMy = $connMySql->query($sql); while ($row = $resultMy->fetch()) { echo $row["field_my"]; }

$sql = "SELECT* FROM table_oracle"; $resultO = $connMySql->query($sql); while ($row = $resultOracle->fetch()) { echo $row["field_oracle"]; }

Thanks again