function addKey() { $db_connection = createDatabaseConnection(); $pid = '0'; $keyName = $_POST['keyName']; $keyID = $_POST['keyID']; $vCode = $_POST['vCode']; $keyXML = getAPIInfo($keyID, $vCode); if ($keyXML !== '') { $uniquepid = false; while (!$uniquepid) { $pid = createRandomString(); $pidcheck = 'SELECT apikey_pid FROM apikeys WHERE apikey_pid=\'' . $pid . '\';'; $others = 0; foreach ($db_connection->query($pidcheck) as $row) { $others++; } if ($others === 0) { $uniquepid = true; } } setAllKeysInactive(); $keyType = getAPIType($keyXML); $isActive = 1; $sql = 'INSERT INTO apikeys (apikey_pid,user_name,apikey_name,apikey_keyid,apikey_vcode,apikey_type,apikey_isactive) VALUES (\'' . $pid . '\',\'' . $_SESSION['user_name'] . '\',\'' . $keyName . '\',\'' . $keyID . '\',\'' . $vCode . '\',\'' . $keyType . '\',\'' . $isActive . '\');'; $db_connection->exec($sql); $_SESSION['keyID'] = $keyID; $_SESSION['vCode'] = $vCode; $_SESSION['selectedCharacter'] = 0; } }
function indexProduct() { ?> <link type="text/css" href="<?php echo WP_PLUGIN_URL; ?> /css/style-admin.css" rel="stylesheet" /> <div class="wrap"> <h1>Gandi product</h1> <br/> Gandi API version : <b><?php echo getAPIInfo(); ?> </b> <br/> <br/> <h2>Simple Hosting index</h2> <br/> <a href="<?php echo admin_url('admin.php?page=listSimpleHosting'); ?> ">Simple Hosting list</a><br/> <br/> <a href="<?php echo admin_url('admin.php?page=configSimpleHosting'); ?> ">Simple Hosting configuration</a> <br/> <br/> <h2>Gandi Server index</h2> <br/> <a href="<?php echo admin_url('admin.php?page=listGandiServer'); ?> ">Gandi Server list</a><br/> <br/> <a href="<?php echo admin_url('admin.php?page=configGandiServer'); ?> ">Gandi Server configuration</a> <br/> <br/> <h2>Gandi Domain Name index</h2> <br/> <br/> <h2>Gandi Email index</h2> <br/> <br/> </div> <?php }