sarvan75 / yii-user-management

Automatically exported from code.google.com/p/yii-user-management
0 stars 0 forks source link

function invitationLink #179

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Link generation is wrong:
generates:index.php?r=profile/friendship/invite&user_id=
results in not found
should generate: index.php?r=friendship/friendship/invite&user_id

Solution:
public static function invitationLink($inviter, $invited) {

        if($inviter === $invited)
            return false;
        if(!is_object($inviter))
            $inviter = YumUser::model()->findByPk($inviter);
        if(!is_object($invited))
            $invited = YumUser::model()->findByPk($invited);

        $friends = $inviter->getFriends(true);
        if($friends && $friends[0] != NULL)
            foreach($friends as $friend) 
                if($friend->id == $invited->id)
                    return false; // already friends, rejected or request pending

        return CHtml::link(Yum::t('Add as a friend'),array(
                    '//friendship/friendship/invite', 'user_id' => $invited->id));
    }
}

Original issue reported on code.google.com by doris.an...@googlemail.com on 20 Dec 2011 at 9:05

GoogleCodeExporter commented 9 years ago
to which revision does this error apply? in my YumFriendshipController.php i 
have the correct link generated?

Original comment by thyseus on 23 Dec 2011 at 11:14

GoogleCodeExporter commented 9 years ago
Hi Stefan,
I used 0.8 rc 5 (latest stable).
Maybe I made a mistake while installation, since I'm new to yii. Just played 
around for 2 days.
Anyhow great work! In one of your forum posts you wrote, that you already 
started to write some connection for cassandra or some other nosql ,but stopped 
because yii is working on an general solution for nosql. I don't think they 
will be finishing this in the near future, according to the fact, that they 
will first release version 1.9 and a lot of issues are still open. I will try 
to implement cassandra by myself using either kallaspriit or pandra or 
cassandra-pdo , which I wasn't able to compile on my windows machine 
yet.(Didn't want to spoil my new squeeze server) But hopefully I will make this 
work in a couple of days. Cassandra latest version is working very well and 
incredibly fast. kallspriit works out of the box already but I didn't write a 
singleton for the connection yet nor an active columnfamily class etc. If you 
got something like that, please could you send me the code? 
Merry christmas,
Doris from Regensburg, Bayern

Original comment by doris.an...@googlemail.com on 24 Dec 2011 at 6:59