', FirstLoginFormFields( 'after_install' ) ); ?>

', FirstLoginFormFields( 'force_password_change' ) ); ?>

diagnostic.php' ); } if ( ( $mode === 'after_install' && User( 'STAFF_ID' ) === '1' ) || $mode === 'force_password_change' ) { $_ROSARIO['allow_edit'] = true; // @since 11.1 Prevent using App name, username, or email in the password $_ROSARIO['PasswordInput']['user_inputs'] = [ User( 'USERNAME' ), User( 'EMAIL' ), ]; // Set password on first login. $fields[] = PasswordInput( '', 'first_login[PASSWORD]', _( 'New Password' ), 'required strength autofocus' ); } return $fields; } } if ( ! function_exists( 'FirstLoginPoll' ) ) { /** * Get First Login Poll * * @since 4.6 * @since 5.2 Add Organization radio inputs. * @since 10.4.1 Add Database Type and Version, add PHP version. * * @return string Poll HTML array or empty string if not 'admin' user or if rosariosis.org not reachable. */ function FirstLoginPoll() { global $locale, $_ROSARIO, $DatabaseType, $db_connection; if ( User( 'STAFF_ID' ) !== '1' ) { return ''; } // Check if client has Internet connection. $has_connection = @file_get_contents( 'https://www.rosariosis.org/installation-poll/poll-submit.php' ); if ( ! $has_connection ) { // Server may be down? return ''; } $fields = []; $fields[] = ''; $fields[] = ''; $fields[] = ''; if ( $DatabaseType === 'postgresql' ) { $database_version = pg_version( $db_connection ); // i.e. 13.8 (Debian 13.8-0+deb11u1), get 13.8 back. $database_version = (float) $database_version['server']; } else { // i.e. version 10.5.15 is 100515 $database_version = mysqli_get_server_version( $db_connection ); $main_version = (int) ( $database_version / 10000 ); // Get 10.5 back. $database_version = $main_version . '.' . (int) ( ( $database_version - ( $main_version * 10000 ) ) / 100 ); } $fields[] = ''; // i.e. 8.1.3, get 8.1 back. $php_version = (float) PHP_VERSION; $fields[] = ''; $_ROSARIO['allow_edit'] = true; $usage_options = [ 'testing' => _( 'Testing' ), 'production' => _( 'Production' ), ]; $fields[] = RadioInput( '', 'usage', _( 'Usage' ), $usage_options, false ); $school_options = [ 'primary' => _( 'Primary' ), 'secondary' => _( 'Secondary' ), 'superior' => _( 'Superior' ), 'other' => _( 'Other' ), ]; $fields[] = RadioInput( '', 'school', _( 'School' ), $school_options, false ); $organization_options = [ 'private' => _( 'Private' ), 'public' => _( 'Public' ), 'non-profit' => _( 'Non-profit' ), ]; $fields[] = RadioInput( '', 'organization', _( 'Organization' ), $organization_options, false ); $fields[] = TextInput( '0', 'students', _( 'Students' ), 'type="number" min="0" max="99999" length="4"', false ); $_ROSARIO['allow_edit'] = false; $fields[] = '
' . Buttons( _( 'Submit' ), _( 'Cancel' ) ) . '
'; $url_lang = ''; if ( $locale === 'es_ES.utf8' || $locale === 'fr_FR.utf8' ) { $url_lang = substr( $locale, 0, 2 ) . '/'; } $fields[] = sprintf( _( 'Poll answers are anonymous. Consult installation statistics online.' ), URLEscape( 'https://www.rosariosis.org/' . $url_lang . 'installation-poll/' ) ); ob_start(); ?> '; $title = '' . _( 'Installation Poll' ) . ''; return $form . '
' . $title . implode( '

', $fields ) . '

' . $js; } }