Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners
Testimonials
Paul Gibson: "The strength of SQL Maestro Group's technical skills and support allow us to recommend PostgreSQL Maestro and PostgreSQL Data Wizard to others. Above that, they provide us with amazing value (great service, fair price) in comparison with every other software development teams that I've researched".
Olivier Auverlot: "At my work (a universitary computer research laboratory), I'm alone to create all applications and databases. I don't know how I could do all the work without it. It's really a very productive software. I can focus on the database schemas and create quickly the user applications with a minimal amount of code to maintain".

More

Add your opinion

SQL Maestro Group / Products / PostgreSQL / News / PHP Generators 20.5 released

PHP Generators 20.5 released

May 18, 2020

Prev
PHP Generator

SQL Maestro Group is happy to announce the release of PHP Generator 20.5, a GUI frontend that allows you to build high-quality and feature-rich data-driven web applications for your database in minutes. There are versions for MySQL, MS SQL Server, PostgreSQL, Oracle, SQLite, Firebird, DB2, SQL Anywhere and MaxDB.

The following is a list of new feature implementations since the last major release. Most of new features can be seen in action in our Feature Demo, Security Demo, and NBA Demo applications.

New feature highlights:

  • This version has been successfully tested with all PHP versions up to 7.4.
  • Tabbed (Multi-Page) Forms. Starting from this version you can organize content of long forms more effectively. Make long forms less intimidating and easier to complete with just a few lines of PHP code placed in the OnGetCustomFormLayout event handler. You can group related input controls in tabs as well as manage the location of the controls within the tab groups. Both horizontal and vertical forms are supported, as well as viewing, editing and inserting modes (separate page, modal window, inline editing and multi editing).
  • New Charts Types. This version extends the already wide spectrum of supported Google charts. As usual, all the chart-specific options can be set with the OnPrepareChart event.
  • Totals for calculated columns. Now it is possible to aggregate values of calculated columns.
    Totals for calculated columnsPicture 10. Totals for calculated columns
    Total content of calculated columns can be customized via OnCustomRenderTotals event.
  • Signature Editor. This new editor allows you to draw on it. The drawing is saved in PNG or JPEG formats and uploaded to a specified folder on a server.
    Signature EditorPicture 11. Signature Editor
  • HTML WYSIWYG Editor has been upgraded. Now it allows you to pick some fonts, change font size, insert an image in base64, add and manage tables, add special characters, wrap/unwrap your code into pre + code tags (preformatted text) and add predefined HTML templates.
    HTML WYSIWYG Editor upgradedPicture 12. HTML WYSIWYG Editor upgraded
  • It is possible now to do not specify a sorting order for the levels of cascading combobox editors. It allows you to use a native sorting order of their data sources.
    No sortingPicture 13. No sorting
  • Security-related enhancements. The new version comes with a number of security-related features as follows:
    • Google reCAPTCHA support. Starting from this version it is possible to add Google reCAPTCHA on Login, Registration, Resend Verification Email and Password Recovery forms to protect them against spam and other types of automated abuse. To start using reCAPTCHA, you need to sign up for an API key pair for your site. Checkbox (I'm not a robot) and Invisible reCAPTCHA are supported.
    • OnAfterFailedLoginAttempt event has been added. This event allows you to trace failed login attempts. It is usually used in conjunction with OnAfterLogin event. For example, you can limit the number of failed login attempts per user and to lock user account after a number of failed login attempts.

      Code Sample (click here to show/hide)

      Listing 1. OnAfterLogin & OnAfterFailedLoginAttempt event handlers example
      function OnAfterLogin($userName, $connection, &$canLogin, &$errorMessage)
      {
        // Retrieve a number of failed login attempts for 
        $sql = "SELECT failed_login_attempts FROM phpgen_users WHERE user_name='$userName'"; 
        $failedLoginAttempts = $connection->ExecScalarSQL($sql);
        if ($failedLoginAttempts > 2) {
          // lock account due to too many failed login attempts
          $canLogin = false;
          $errorMessage = 
            "Dear $userName, your account is locked due to too many failed login attempts. " .
            'Please contact our support team.';
        } else {
          // Reset counter of failed login attempts
          $sql = "UPDATE phpgen_users SET failed_login_attempts = 0 WHERE user_name='$userName'";
          $connection->ExecSQL($sql);
        } 
      }
       
      function OnAfterFailedLoginAttempt($userName, $connection, &$errorMessage)
      {
        // Retrieve a number of previous failed login attempts
        $sql = "SELECT failed_login_attempts FROM phpgen_users WHERE user_name='$userName'"; 
        $failedLoginAttempts = $connection->ExecScalarSQL($sql);
       
        // Increment counter of failed login attempts
        $failedLoginAttempts++;
       
        // Display message based on a number of failed login attempts   
        if ($failedLoginAttempts == 2) {
          $errorMessage = 'You have one attempt left before your account will be locked.';
        } elseif ($failedLoginAttempts > 2) {
          $errorMessage = 
            "Dear $userName, your account is locked due to too many failed login attempts. " .
            'Please contact our support team.';
        }
       
        // Update a counter of failed login attempts in users table
        if ($failedLoginAttempts < 3) { 
          $sql = 
            "UPDATE phpgen_users " .
            "SET failed_login_attempts = $failedLoginAttempts " .
            "WHERE user_name='$userName'";
          $connection->ExecSQL($sql);
        }
      }
    • OnVerifyPasswordStrength event has been implemented. This event allows you to verify an entered password. The password is accepted only when it meets specified complexity requirements.

      Code Sample (click here to show/hide)

      Listing 2. OnVerifyPasswordStrength event handler example
      function OnVerifyPasswordStrength($password, &$acceptPassword, &$passwordRuleMessage)
      {
        $atleastOneUppercaseRule   = preg_match('@[A-Z]@', $password);
        $atleastOneLowercaseRule   = preg_match('@[a-z]@', $password);
        $atleastOneNumberRule      = preg_match('@[0-9]@', $password);
        $atleastOneSpecialCharRule = preg_match('@[^\w]@', $password);
       
        $acceptPassword = 
          strlen($password) >= 8 &&
          $atleastOneUppercaseRule &&
          $atleastOneLowercaseRule &&
          $atleastOneNumberRule &&
          $atleastOneSpecialCharRule;
       
        $passwordRuleMessage = 
          'Password must be at least 8 characters in length ' . 
          'and must include at least one upper case letter, ' . 
          'one lower case letter, one number, and one special character.';
      }
    • OnGetCustomPagePermissions event has been revised. This event introduces four new parameters: $pageName, $userId, $userName, and $connection. The $page and $handled parameters were removed.

      All calls of $page->GetCurrentUserName(), $page->GetCurrentUserId() and $page->GetConnection() functions which could be used in this event will be automatically replaced with $userName, $userId and $connection new parameters, respectively, when old projects loading.

    • All security events were moved to Security options window and can be edited in one place now.
      Security eventsPicture 15. Security events
    • The "Set the home page as a startup page" option has been added. If it is enabled then a user will be redirected to the home page after logging in, otherwise he will be redirected to the first page of an application he has access to.
      Set the home page as a startup page optionPicture 16. Set the home page as a startup page option
  • Two new options have been added to "Export and Print" tab of Page Properties, Project Options and Application Options dialogs.
    • The "Open print form in new tab" option allows you to open print forms in a new browser tab.
    • The "Open exported PDF in new tab" option allows you to open exported PDFs in a new browser tab.
    The both options are enabled by default.
    Export & Print optionsPicture 17. Export & Print options
  • Template management. Now it is possible to customize grid toolbars. Just create a new grid toolbar template or modify the existing one (components/templates/list/grid_toolbar.tpl), upload it to the components/templates/custom_templates directory and specify the following code in the page's OnGetCustomTemplate event handler.
    Listing 3. OnGetCustomTemplate event example
    if ($part == PagePart::GridToolbar && $mode == PageMode::ViewAll) {
        $result = 'custom_grid_toolbar.tpl';
    }

    Screenshot below demonstrates a grid toolbar equipped with a new button allowing to select a random table record.

    Lookup data viewPicture 18. Customized grid toolbar
    Learn the appropriate example in our Feature Demo application.
  • Event management enhancements.
    • OnAddEnvironmentVariables event has been added. This event allows you to add your own environment variables, which can be used in any server-side event, page and lookup filters as any predefined variables like %CURRENT_USER_ID% or %CURRENT_DATE%.
    • OnGetCustomExportOptions event now allows you to specify margins, header and footer of the page for export to PDF.
      Export to pdf (Header & Footer)Picture 19. Export to pdf (Header & Footer)
    • OnGetCustomFormLayout event: it is now possible to set HTML attributes and styles for each group of related input controls in a form, hide/show groups, and specify a layout mode (horizontal or vertical) for each group/tab in a form.
      Group layout modesPicture 20. Group layout modes
  • If one of the primary key columns in your updatable query or a view is autoincrement, it is possible now to set the appropriate flag. It allows locating the newly record added via inline or modal forms correctly.
    Autoincrement key columnPicture 21. Autoincrement key column
  • From now on, Windows environment variables can be used in the output and additional output directories' names.
    Using of Windows environment variables in output directory namePicture 22. Using of Windows environment variables in the output directory name
  • A Finnish translation has been added. Now PHP Generator comes with 20 languages on board. Thanks to our users.

In addition to above, several bugs have been fixed and some other minor improvements and corrections have been made. For more information about a specific tool see the appropriate page:

Prev