Beispiel #1
0
     } else {
         $Query = sprintf("select group_name from " . TABLE_PREFIX . "groups where group_id=" . $group_id . " and password='******'");
         //echo($Query . "<br>\n");
         $dbResult = $dblink->query($Query);
         $check = 0;
         while ($row =& $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) {
             $check++;
         }
         if ($check == 1) {
             //Insert member into the gsubscriptions table
             $Query = "INSERT INTO " . TABLE_PREFIX . "gsubscriptions ( Group_ID , Name , Date_Join , Priv ) VALUES ('{$group_id}', '{$username}', now(), '1')";
             //echo($Query . "<br>\n");
             $AffectedRows = $dblink->exec($Query);
             if ($AffectedRows == 1) {
                 //Create the folder under the member's Groups folder with the Group name and description of the group
                 $success = createMemberGroupFolder($username, returnGroupName($group_id), returnGroupDesc($group_id));
                 if ($success == 1) {
                     $success = true;
                     echo "<p class=\"success\">" . T_("Your are now a member of this group") . ".</p><p><b>" . T_("Details of the group") . "</b><br><br>";
                     include 'includes/gdetails_body.php';
                 } else {
                     echo "<p class=\"error\">" . T_("A problem occured when creating the folder of this group") . ".</p>";
                 }
             } else {
                 echo "<p class=\"error\">" . T_("A problem occured when adding you to this group") . ".</p>";
             }
         } else {
             echo "<p class=\"error\">" . T_("The password you entered is invalid") . ".</p>";
         }
     }
 }
Beispiel #2
0
                 $xusers++;
             }
             if ($xusers == 0) {
                 //encrypt password
                 if ($pass != null) {
                     $passencrypt = $user->encryptPassword($pass);
                 } else {
                     $passencrypt = "";
                 }
                 $Query = "INSERT INTO " . TABLE_PREFIX . "groups ( Group_Name , Manager , Description , Password , Date_Created ) VALUES ('{$gname}', '{$manager}', '{$description}', '{$passencrypt}', now())";
                 //echo($Query . "<br>\n");
                 $AffectedRows = $dblink->exec($Query);
                 if ($AffectedRows == 1) {
                     //Create the folder under the member's Groups folder with the Group name and description of the group
                     include 'includes/groups_functions.php';
                     $success = createMemberGroupFolder($manager, $gname, $description);
                     if ($success == 1) {
                         $success = true;
                         echo "<p class=\"success\">" . T_("The group was successfully created") . ".</p>";
                     } else {
                         echo "<p class=\"error\">" . T_("A problem occured when creating the folder of this group") . ".</p>";
                     }
                 } else {
                     echo "<p class=\"error\">" . T_("A problem occured when creating your group information") . ".</p>";
                 }
             } else {
                 echo "<p class=\"error\">" . T_("This group name is already taken") . "!</p><p>" . T_("Please choose a different group name") . ".</p>";
             }
         }
     }
 } else {