SyuTingSong / phpliteadmin

Automatically exported from code.google.com/p/phpliteadmin
0 stars 0 forks source link

Return link after renaming table goes to database page #230

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Choose a table
2. Choose tab "table_rename"
3. Set another name
4. Below the confirmation message there's a return link. Click it.

Instead of going to "row_view" of that table, phpliteadmin goes to database 
page.

To fix it, I propose using something like

    //user has performed some action so show the resulting message
    if(isset($_GET['confirm']))
    {
        echo "<div id='main'>";
        echo "<div class='confirm'>";
        if(isset($error) && $error) //an error occured during the action, so show an error message
            echo $lang['err'].": ".$db->getError().".<br/>".$lang['bug_report'].' '.PROJECT_BUGTRACKER_LINK;
        else //action was performed successfully - show success message
            echo $completed;
        echo "</div><br/><br/>";
        if($_GET['action']=="row_delete" || $_GET['action']=="row_create" || $_GET['action']=="row_edit")
            echo "<a href='".PAGE."?table=".urlencode($_GET['table'])."&amp;action=row_view'>".$lang['return']."</a>";
        else if($_GET['action']=="column_create" || $_GET['action']=="column_delete" || $_GET['action']=="column_edit" || $_GET['action']=="index_create" || $_GET['action']=="index_delete" || $_GET['action']=="trigger_delete" || $_GET['action']=="trigger_create")
            echo "<a href='".PAGE."?table=".urlencode($_GET['table'])."&amp;action=column_view'>".$lang['return']."</a>";
        else if($_GET['action']==="table_rename")
            echo "<a href='".PAGE."?table=".urlencode($_POST['newname'])."&amp;action=row_view'>".$lang['return']."</a>";
        else
            echo "<a href='".PAGE."'>".$lang['return']."</a>";
        echo "</div>";
    }

instead of

    //user has performed some action so show the resulting message
    if(isset($_GET['confirm']))
    {
        echo "<div id='main'>";
        echo "<div class='confirm'>";
        if(isset($error) && $error) //an error occured during the action, so show an error message
            echo $lang['err'].": ".$db->getError().".<br/>".$lang['bug_report'].' '.PROJECT_BUGTRACKER_LINK;
        else //action was performed successfully - show success message
            echo $completed;
        echo "</div>";
        if($_GET['action']=="row_delete" || $_GET['action']=="row_create" || $_GET['action']=="row_edit")
            echo "<br/><br/><a href='".PAGE."?table=".urlencode($_GET['table'])."&amp;action=row_view'>".$lang['return']."</a>";
        else if($_GET['action']=="column_create" || $_GET['action']=="column_delete" || $_GET['action']=="column_edit" || $_GET['action']=="index_create" || $_GET['action']=="index_delete" || $_GET['action']=="trigger_delete" || $_GET['action']=="trigger_create")
            echo "<br/><br/><a href='".PAGE."?table=".urlencode($_GET['table'])."&amp;action=column_view'>".$lang['return']."</a>";
        else
            echo "<br/><br/><a href='".PAGE."'>".$lang['return']."</a>";
        echo "</div>";
    }

I am using
* phpLiteAdmin v1.9.4.1 
* PHP 5.4.17
* PDO
* SQLite version 3.7.7.1
* Apache 2.4.6
* Windows XP SP3

Original issue reported on code.google.com by Loiroor...@gmail.com on 30 Aug 2013 at 6:52

GoogleCodeExporter commented 9 years ago
Problem with this is that there are multiple ways from where you can get there. 
You can also get to the table_rename action from the database page. And in this 
case, you'd also expect to get back to the db page when clicking "Return".
So I guess we'd need to differ between these two cases.

Original comment by crazy4ch...@gmail.com on 24 Dec 2013 at 1:33

GoogleCodeExporter commented 9 years ago
We now go back to the row_view action as of r444, so I consider this one as 
fixed.

Original comment by crazy4ch...@gmail.com on 29 Dec 2013 at 11:22