示例#1
0
						{
							dolibarr_install_syslog("etape1: User already exists");
							print '<tr><td>';
							print $langs->trans("UserCreation").' : ';
							print $dolibarr_main_db_user;
							print '</td>';
							print '<td>'.$langs->trans("LoginAlreadyExists").'</td></tr>';
						}
						else
						{
							dolibarr_install_syslog("etape1: Failed to create user");
							print '<tr><td>';
							print $langs->trans("UserCreation").' : ';
							print $dolibarr_main_db_user;
							print '</td>';
							print '<td>'.$langs->trans("Error").' '.$db->error()."</td></tr>";
						}
					}

					$db->close();
				}
				else
				{
					print '<tr><td>';
					print $langs->trans("UserCreation").' : ';
					print $dolibarr_main_db_user;
					print '</td>';
					print '<td>'.$langs->trans("Error").'</td>';
					print '</tr>';

					// Affiche aide diagnostique
示例#2
0
 /**
  *  Fonction qui dit si cet utilisateur est un redacteur existant dans spip
  *  @return     int     1=existe, 0=n'existe pas, -1=erreur
  */
 function is_in_spip()
 {
     if (defined("ADHERENT_USE_SPIP") && ADHERENT_USE_SPIP == 1 && defined('ADHERENT_SPIP_SERVEUR') && ADHERENT_SPIP_SERVEUR != '' && defined('ADHERENT_SPIP_USER') && ADHERENT_SPIP_USER != '' && defined('ADHERENT_SPIP_PASS') && ADHERENT_SPIP_PASS != '' && defined('ADHERENT_SPIP_DB') && ADHERENT_SPIP_DB != '') {
         $query = "SELECT login FROM spip_auteurs WHERE login='******'";
         $mydb = new DoliDb('mysql', ADHERENT_SPIP_SERVEUR, ADHERENT_SPIP_USER, ADHERENT_SPIP_PASS, ADHERENT_SPIP_DB, ADHERENT_SPIP_PORT);
         if ($mydb->ok) {
             $result = $mydb->query($query);
             if ($result) {
                 if ($mydb->num_rows($result)) {
                     # nous avons au moins une reponse
                     $mydb->close($result);
                     return 1;
                 } else {
                     # nous n'avons pas de reponse => n'existe pas
                     $mydb->close($result);
                     return 0;
                 }
             } else {
                 # error
                 $this->error = $mydb->error();
                 return -1;
             }
         } else {
             $this->error = "Echec de connexion avec les identifiants " . ADHERENT_SPIP_SERVEUR . " " . ADHERENT_SPIP_USER . " " . ADHERENT_SPIP_PASS . " " . ADHERENT_SPIP_DB;
             return -1;
         }
     }
 }
示例#3
0
					// print "<td>OK requete ==== $buffer</td></tr>";
					$db->free($resql);
				}
				else
				{
					if ($db->errno() == 'DB_ERROR_TABLE_ALREADY_EXISTS' ||
					$db->errno() == 'DB_ERROR_TABLE_OR_KEY_ALREADY_EXISTS')
					{
						//print "<td>Deja existante</td></tr>";
					}
					else
					{
						print "<tr><td>".$langs->trans("CreateTableAndPrimaryKey",$name);
						print "<br>\n".$langs->trans("Request").' '.$requestnb.' : '.$buffer;
						print "\n</td>";
						print "<td>".$langs->trans("ErrorSQL")." ".$db->errno()." ".$db->error()."</td></tr>";
						$error++;
					}
				}
			}
			else
			{
				print "<tr><td>".$langs->trans("CreateTableAndPrimaryKey",$name);
				print "</td>";
				print "<td>".$langs->trans("Error")." Failed to open file ".$dir.$file."</td></tr>";
				$error++;
				dolibarr_install_syslog("Failed to open file ".$dir.$file,LOG_ERR);
			}
		}

		if ($tablefound)