Beispiel #1
0
def main():
    """
   Form to process Email.
   """
    PrintHeader(style_activate)
    form = cgi.FieldStorage()
    email, ticket, error = ProcessName(form)
    if not error:
        error = sql_activate(email, ticket)
    if error == 0:
        print """<p>Welcome to PHC Web Interface. Your account has been activated.</p>  <a href='login.py'>
               Sign in PHC Web Interface</a>"""
    elif error == 1:
        print " Welcome to PHC Web Interface. You haven't registered. Please register here."
    elif error == 2:
        print """<p> Welcome to PHC Web Interface. There is something wrong with the activation link. </p> Send me the link again?"""
        Activate_Link()
        print """ <p> Haven't registered? Click here. <a href='register.py'>Create a new account.</a>"""
    elif error == 3:
        print """<p>Welcome to PHC Web Interface. You have activated your account before.</p>  <a href='login.py'>
               Sign in PHC Web Interface</a>"""
    else:
        print """ Sorry. There is some mistake in your account. Error = %d. </p> Report here. <a href='contact.py'>Contact Us.</a>""" % error
    Footer_Bar()
    print "</body></html>\n"
Beispiel #2
0
def main():
    """
    Form to process login.
    """
    PrintHeader(style_login)
    print """<div class="center1">"""
    AskName()
    print """<div class="photo"><a href="demo.py" id="login-create-an-account"><img src="../imag/Path.jpg" alt="PHC Web Interface"></a></div>"""
    print "</div>"
    Footer_Bar()
    print "</div></body></html>\n"
Beispiel #3
0
def main():
    """
   Form to process Email.
   """
    PrintHeader(style_reg)
    form = cgi.FieldStorage()
    infos, error = ProcessName(form)
    if not error[0]:
        error[0], ticket = sql_reg(infos)
        if not error[0]:
            print """
               Congratulations! Register successful.</p>
               Please check your mailbox to activate your account."""

    if error[0]:
        print """<html><body>
               <div>
               <h1> Register </h1>
               <form method = "post" autocomplete="off"
                     action = "register.py">"""
        print """<table border="0">"""


        form_list = [[infos[0], 'Email'           , 'login'      ],\
                     [infos[1], 'Password'        , 'passw'      ],\
                     [infos[2], 'Confirm Password', 'passw_check'],\
                     [infos[3], 'First Name'      , 'Name_First' ],\
                     [infos[4], 'Last Name'       , 'Name_Last'  ],\
                     [infos[5], 'Organization'    , 'Org'        ]]

        # First Name
        for i in xrange(len(form_list)):
            print """<tr><td class="reg_form">%s</td>""" % form_list[i][1]
            if i == 1 or i == 2:
                print """<td><input type="password" name="%s" maxlength="15">
                     </td></tr>""" % form_list[i][2]
            else:
                if form_list[i][0] == '':
                    print """<td><input type="text" name="%s" spellcheck="false" >
                        </td></tr>""" % form_list[i][2]
                else:
                    print """<td><input type = "text" name = "%s"  
                      spellcheck="false"  value =%s></td><td>V</td>"""\
                          %(form_list[i][2],form_list[i][0])
                print "</tr>"

        print """</table>
         <input type="submit" value="Submit">
         </form>
         </div>"""
    handle_error(error)
    Footer_Bar()
    print "</body></html>\n"
Beispiel #4
0
def main():
    """
   About
   """
    # PHCpack Web Interface Header

    PrintHeader(style_about)

    phc_login_simple()

    print_about()

    Footer_Bar()

    print "</body></html>\n"
Beispiel #5
0
def main():
    """
   Form to process Email.
   """
    PrintHeader('login')
    form = cgi.FieldStorage()
    infos, error = ProcessName(form)
    if not error[0]:
        error[0] = sql_checkticket(infos[0], infos[1])
        if not error[0]:
            sql_resetpwd(infos[1], infos[2])
            print """<p>Welcome to PHC Web Interface. Your password has been reset.</p>  <a href='login.py'>
               Sign in PHC Web Interface</a>"""

    if error[0]:
        print """<html><body>
               <div>
               <h1> Reset password </h1>
               <form method = "post" 
                     action = "resetpwd.py">"""

        # Password
        print """<table border="0"><tr>
      <td>Password</td>
      <td><input type = "password" name = "passw"
             size = "30" maxlength = "15">
      </td>
      </tr>
      <tr>
      <td>Confirm Password</td>
      <td>
      <input type = "password" name = "passw_check"
             size = "30" maxlength = "15">
      </td>
      </tr>
      </table>"""

        # Submit bottum
        print """
         <input type = "hidden" name = "login" value ="%s">
         <input type = "hidden" name = "ticket" value ="%s">
         <input type="submit" value="Reset">
         </form>
         </div>""" % (infos[0], infos[1])

    handle_error(error)
    Footer_Bar()
    print "</body></html>\n"
Beispiel #6
0
def main():
    """
   About
   """

    PrintHeader(style_demo)

    phc_login_simple()

    print """<p><h2>A brief introduction to PHCWeb</h2>"""

    print """<div class='notice'>
<p>PHCpack Web Interface intends to create an intuitive user interface to solve polynomial systems.</p>"""

    print """<div style="text-align:center;"><img src="../imag/Path.jpg" alt="PHC Web Interface" width="400"></div>"""

    print """<p><b>Benefits: </b></p><ul>
<li>No installation required</li>
<li>We provide a computational server, hosted by fast computers</li>
<li>Manage the solved polynomial systems</li>
<li>Solve polynomial systems anywhere from cell phone to tablet</li>
</ul>"""

    print """<p><b>Main functions of PHCpack Web Interface:</b></p>
   <ul>
<li><a href="#solve">How to solve a polynomial system by PHCWeb?</a></li>
<li><a href="#mypoly">How to manage my polynomial systems in PHCWeb?</a></li>
</ul>"""

    print """</div>"""

    print """<h2><a name="solve" id="solve">How to solve a polynomial system by PHCWeb?</a></h2>"""

    print """<ol>
<li style="font-size:120%">Enter your polynomial system in the textarea.</li>"""

    print """<div style="text-align:center; margin-top:15px; margin-bottom: 25px"><img src="../imag/Intro/poly.png" alt="PHC Web Interface"></div>"""

    print """<li style="font-size:120%">Click "Solve" button to get solutions. If the solution is large, it will take some time and you might need to click update to check the newest result.</li>"""

    print """<div style="text-align:center;margin-top:15px; margin-bottom: 25px"><img src="../imag/Intro/Solution.png" alt="PHC Web Interface"></div>"""

    print """<li style="font-size:120%">Give your system a name. Click on "Save as" to save it.</li>"""

    print """<div style="text-align:center;margin-top:15px; margin-bottom: 25px"><img src="../imag/Intro/saveas.png" alt="PHC Web Interface"></div>"""

    print """<li style="font-size:120%">If you have a similar solution with different efficients. Click on "Solve Similar", change the coefficents and use homotopy to solve your new system.</li>"""

    print """<div style="text-align:center;margin-top:15px; margin-bottom: 25px"><img src="../imag/Intro/startsystem.png" alt="PHC Web Interface"></div></ol>"""

    print """<h2><a name="mypoly" id="mypoly">How to manage my polynomial systems in PHCWeb?</a></h2>"""

    print """<ol>
<li style="font-size:120%">Click "My Polynomial Systems" on the top.</li>"""
    print """<div style="text-align:center;margin-top:15px; margin-bottom: 25px"><img src="../imag/Intro/topbar.png" alt="PHC Web Interface"></div>"""
    print """<li style="font-size:120%">You have entire table of all polynomials you have solved. You can check solutions and phc report. You can also transfer solution to maple or python format.</li>"""
    print """<div style="text-align:center;margin-top:15px; margin-bottom: 25px"><img src="../imag/Intro/mypoly.png" alt="PHC Web Interface"></div></ol>"""

    print """</ol>"""

    print """</ol>"""

    Footer_Bar()

    print "</body></html>\n"
Beispiel #7
0
def main():
    """
   Form to process login.
   """
    PrintHeader(style_contact)
    form = cgi.FieldStorage()
    infos, error = Contact_Process(form)
    send_gmail = 0
    if not error[0]:
        error[0] = Contact_Email(infos)
        if not error[0]:
            send_gmail = 1

    phc_login_simple()

    print """<html><body>
            <p><h2>Contact Us</h2>
            <form name = "contact" method = "post" 
                  action = "contact.py">
            <table border="0" width = "100%"><tr>"""

    form_list = [['Email','login'],\
                 ['First Name', 'Name_First'],\
                 ['Last Name','Name_Last'],\
                 ['Organization','Org'],\
                 ['Subject','Subject']]

    for i in xrange(len(form_list)):
        print """<td class="reg_form">%s</td>""" % form_list[i][0]
        if infos[i] == '':
            print """<td><input type="text" name="%s" spellcheck="false"  >
         </td></tr>""" % form_list[i][1]
        else:
            print """<td><input type = "text" name = "%s"  
                              spellcheck="false"  value ="%s" ></td><td>V</td>
         </tr>""" % (form_list[i][1], infos[i])

    # Message
    print """<tr><td class="reg_form" valign="top">Message</td>"""
    Print_JS()
    if infos[5] == '':
        print """
      <td><textarea name="Message" rows = 8  onfocus="clearTextArea();">Please enter your information</textarea></td>
      </tr>
      </table>"""
    else:
        print """<td><textarea name="Message" rows = 8 >%s</textarea></td><td valign="top">V</td>
      </tr>
      </table>""" % infos[5]

    if send_gmail == 1:
        print """<p>Thank you. Your message has been sent to us. A copy of message has been forwarded to your own email address.</p>
    <p>We will reply to you as soon as possible.</p>"""
    else:
        # Submit bottum
        print """
         <input type="submit" value="Submit">
         </form>"""
    handle_error(error)
    Footer_Bar()
    print "</body></html>\n"
Beispiel #8
0
def main():
    """
   Form to process Email.
   """
    PrintHeader(style_forgetpwd)
    form = cgi.FieldStorage()
    infos, error = ProcessName(form)

    Email_Address = infos[0]
    Name_First = infos[1]
    Name_Last = infos[2]
    Org = infos[3]

    if not error[0]:
        error[0] = sql_forgetpwd(Email_Address, Name_First, Name_Last, Org)
        if not error[0]:
            print """
               The reset link has been sent to your mailbox.</p>
               Please check your mailbox to reset your password."""

    if error[0]:
        print """<html><body>
               <div>
               <h1> Forget password </h1>
               <form method = "post" 
                     action = "forgetpwd.py">"""
        print """<table border="0">"""

        # Email Address
        print """<tr><td class="reg_form">Email</td>"""

        if Email_Address == '':
            print """<td><input type="text" name="login" spellcheck="false">
         </td><td></td>"""
        else:
            if error[0] == 4:
                print """<td><input type = "text" name = "login"  
                                 spellcheck="false"  value =%s ></td><td><font color="red">  X</font></td>""" % infos[
                    0]
            else:
                print """<td><input type = "text" name = "login"  
                                 spellcheck="false"  value =%s></td><td>V</td>""" % Email_Address

        print "</tr>"

        form_list = [[Name_First, 'First Name', 'Name_First'],\
                     [Name_Last , 'Last Name','Name_Last'],\
                     [Org, 'Organization','Org']]

        # First Name
        for i in xrange(len(form_list)):
            print """<tr><td class="reg_form">%s</td>""" % form_list[i][1]
            if form_list[i][0] == '':
                print """<td><input type="text" name="%s" spellcheck="false" >
            </td></tr>""" % form_list[i][2]
            else:
                print """<td><input type = "text" name = "%s"  
                   spellcheck="false"  value =%s></td><td>V</td>"""\
                      %(form_list[i][2],form_list[i][0])
            print "</tr>"

        print "</table>"

        # Submit bottum
        print """<input type="submit" value="Submit">
         </form>
         </div>"""
    handle_error(error)
    Footer_Bar()
    print "</body></html>\n"