Exemple #1
0
</h2>
            <p><?php 
        if ($step == 'i6') {
            echo _T("To run, Galette needs a number of rights on the database (CREATE, DROP, DELETE, UPDATE, SELECT and INSERT)");
        }
        if ($step == 'u6') {
            echo _T("In order to be updated, Galette needs a number of rights on the database (CREATE, DROP, DELETE, UPDATE, SELECT and INSERT)");
        }
        ?>
</p>
    <?php 
        /** FIXME: when tables already exists and DROP not allowed at this time
            the showed error is about CREATE, whenever CREATE is allowed */
        //We delete the table if exists, no error at this time
        $zdb->dropTestTable();
        $results = $zdb->grantCheck(substr($step, 0, 1));
        $result = '';
        $error = false;
        //test returned values
        if ($results['create'] instanceof Exception) {
            $result .= '<li class="install-bad debuginfos">' . _T("CREATE operation not allowed") . '<span>' . $results['create']->getMessage() . '</span></li>';
            $error = true;
        } elseif ($results['create'] != '') {
            $result .= '<li class="install-ok">' . _T("CREATE operation allowed") . '</li>';
        }
        if ($results['insert'] instanceof Exception) {
            $result .= '<li class="install-bad debuginfos">' . _T("INSERT operation not allowed") . '<span>' . $results['insert']->getMessage() . '</span></li>';
            $error = true;
        } elseif ($results['insert'] != '') {
            $result .= '<li class="install-ok">' . _T("INSERT operation allowed") . '</li>';
        }