Exemplo n.º 1
0
function get_fdescription($folderid, $uname, $pid = 0)
{
    if ($folderid == "-1") {
        $description = T_("Group folders");
    } else {
        include 'conn.php';
        if ($pid == -1) {
            include 'groups_functions.php';
            $description = returnGroupDesc(returnGroupID(returnFolderName($folderid)));
        } else {
            $Query = "select description from " . TABLE_PREFIX . "folders where id='{$folderid}' and name='{$uname}'";
            //echo($Query . "<br>\n");
            $dbResult = $dblink->query($Query);
            if ($row =& $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) {
                $description = "{$row["description"]}";
            }
        }
    }
    return $description;
}
Exemplo n.º 2
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>";
         }
     }
 }